Skip to main content
POST
/
workflows
/
validate
Validate workflow script
curl --request POST \
  --url https://api.trymaitai.ai/api/v1/workflows/validate \
  --header 'Content-Type: application/json' \
  --header 'X-Maitai-Api-Key: <api-key>' \
  --data @- <<EOF
{
  "code": "def execute(ctx):\n    return {'ok': True}",
  "kind": "execute"
}
EOF
{
  "data": {
    "ok": true,
    "errors": []
  }
}

Authorizations

X-Maitai-Api-Key
string
header
required

Your Maitai API key from the Portal.

Body

application/json
code
string
required

Python source to validate.

kind
enum<string>

execute (default) = main def execute(ctx); transform = transform_session(session); schema = INPUT/OUTPUT schema RHS expression; bundle = full workflow script with schemas + transform.

Available options:
execute,
transform,
schema,
bundle
input_schema
string

Bundle kind only: Python literal dict assigned to INPUT_SCHEMA. Validated as a top-level dict.

output_schema
string

Bundle kind only: Python literal dict assigned to OUTPUT_SCHEMA. Validated as a top-level dict.

transform_session
string

Bundle kind only: Python source for transform_session(session) function.

transform_enabled
boolean

Bundle kind only: Whether transform_session is enabled.

expect_workflow_context_import
boolean

Bundle kind only: If true, require WorkflowContext import when referenced. Defaults to false.

Response

200 - application/json

Validate workflow script.

data
any