Overview
Every Nen workflow is a Python file with arun() function.
Lifecycle
The workflow engine validates inputs, calls your run() function, and validates the result. If the run completes successfully, the workflow engine marks the run as completed.Failing a Run
Raise any exception fromrun() to mark the run as failed. The exception message is sent to the error webhook and surfaced to the caller.
Signature
run() supports two signatures:
| Parameter | Type | Description |
|---|---|---|
params | Pydantic BaseModel | Validated from JSON input |
secure_params | Pydantic BaseModel with Secure[str] fields | Optional. Secret references injected by the orchestrator |
| Return | Pydantic BaseModel | Validated and serialized to JSON |
Version Header
Every workflow file should declare the SDK version it targets:Examples
Simple workflow
workflow.py
With field constraints
workflow.py
With secure params
workflow.py