Skip to content

Create workflow ​


Creates a workflow configuration that listens to a trigger and executes one or more steps when the trigger occurs. The workflow configuration supports JSONata expressions for: - Conditional execution (run_if) - Dynamic step configuration (config) Cron expressions can be provided at the step level to schedule execution.

Endpoint ​

http
POST /workflow

Request Body ​

id
string · uuid

Optional workflow ID. If not provided, it will be generated.

Example: 4a4de828-f4c9-4bea-8ef4-2d705aec43bc
environment_id
string · uuid

The environment in which this workflow is created.

Example: 05daecaf-4365-42e8-8370-8127de5dd717
trigger_name
string

The event that triggers this workflow.

Example: integrated_account:connected
config
object
REQUIRED · 

Workflow execution configuration.

run_if
string

JSONata condition evaluated before executing workflow steps.

Example: integration.name = 'calcom'
steps
object[]
type
string

Step execution type.

All possible enum values:
  • run
Example: run
action
string

Action executed by the step.

Example: run_sync_job
cron_expression
string

Optional cron expression for scheduled execution.

Example: 0 */6 * * *
config
string

JSONata expression evaluated at runtime to generate the step execution payload.

Example: ( $sync_job_id := $mapValues(integration.name,{ "calcom": "51b79ace-a7b4-4077-93ba-8048a06ece2b" }); { "sync_job_id": $sync_job_id, "integrated_account_id": integrated_account_id, "webhook_id": "9fda519d-148f-4cc5-bbac-4e373b16e5d4" } )

Response Body ​

id
string · uuid
Example: 4a4de828-f4db-4c9e-adfd-434e0864c3c7
environment_id
string · uuid
Example: 05daecaf-4365-42e8-8370-8127de5dd717
trigger_name
string
Example: integrated_account:connected
config
object
REQUIRED · 

Workflow execution configuration.

run_if
string

JSONata condition evaluated before executing workflow steps.

Example: integration.name = 'calcom'
steps
object[]
type
string

Step execution type.

All possible enum values:
  • run
Example: run
action
string

Action executed by the step.

Example: run_sync_job
cron_expression
string

Optional cron expression for scheduled execution.

Example: 0 */6 * * *
config
string

JSONata expression evaluated at runtime to generate the step execution payload.

Example: ( $sync_job_id := $mapValues(integration.name,{ "calcom": "51b79ace-a7b4-4077-93ba-8048a06ece2b" }); { "sync_job_id": $sync_job_id, "integrated_account_id": integrated_account_id, "webhook_id": "9fda519d-148f-4cc5-bbac-4e373b16e5d4" } )
created_at
string · date-time
updated_at
string · date-time