Skip to main content
POST
/
workflows
Create workflow
curl --request POST \
  --url https://api.trymaitai.ai/api/v1/workflows \
  --header 'Content-Type: application/json' \
  --header 'X-Maitai-Api-Key: <api-key>' \
  --data '
{
  "workflow_ref_name": "hs_classification",
  "script": "def run(input): return input",
  "workflow_name": "HS Classification",
  "application_id": 42,
  "execution_mode": "sync",
  "transform_enabled": true,
  "transform_session": "def transform_session(session): return session"
}
'
{
  "data": "<unknown>"
}

Authorizations

X-Maitai-Api-Key
string
header
required

Your Maitai API key from the Portal.

Body

application/json
workflow_ref_name
string
required
script
string
required

Workflow Python source. Or send multipart script_file / workflow_file / file.

workflow_name
string

Display name. Defaults from workflow_ref_name when omitted.

application_id
integer
application_name
string

Bind to application by name; creates if missing.

description
string
timeout_seconds
integer
execution_mode
enum<string>

Workflow execution mode. Defaults to sync.

Available options:
sync,
async,
stream
transform_enabled
boolean
transform_session
string
input_schema
object
output_schema
object
allow_inproc_nesting
boolean

Allow in-pod nested workflow invocations.

inproc_nested_refs
string[]

Child workflow refs allowed for in-pod routing.

Response

200 - application/json

Create workflow.

data
any