Skip to main content

create_workflow

Function create_workflow 

Source
pub async fn create_workflow(
    __arg0: State<AppState>,
    __arg1: Json<WorkflowBuilder>,
) -> Result<Json<WorkflowDefinition>, ApiError>
Expand description

Create a new workflow definition.

Accepts a WorkflowBuilder and validates it into a finalized WorkflowDefinition. If validation succeeds, the workflow is persisted and the stored definition is returned.

§Route

POST /workflows

§Errors

  • Returns an error if the workflow definition fails validation.
  • Returns an error if persistence fails.

§Notes

This endpoint is intended only for creating new workflows. Updates to existing workflows should be handled via a separate endpoint to allow different validation and lifecycle rules.