Skip to main content
POST
/
workflows
Create a new workflow
curl --request POST \
  --url https://api.altostrat.io/workflows \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "New Customer Onboarding",
  "description": "Sends a welcome email when a new site is created.",
  "is_active": true,
  "authorization_id": "auth_01H...",
  "schedule_type": "manual",
  "nodes": [
    {
      "id": "n1",
      "type": "manual_trigger",
      "position": {
        "x": 100,
        "y": 100
      },
      "data": {
        "componentId": "manual_trigger",
        "description": "Manually trigger this onboarding flow."
      }
    },
    {
      "id": "n2",
      "type": "webhook",
      "position": {
        "x": 400,
        "y": 100
      },
      "data": {
        "componentId": "webhook",
        "method": "POST",
        "url": "https://example.com/api/welcome",
        "body": "{\"message\": \"Welcome!\", \"run_id\": \"{{ n1.run_id }}\"}"
      }
    }
  ],
  "edges": [
    {
      "id": "e1-2",
      "source": "n1",
      "target": "n2"
    }
  ]
}'
{
  "id": "fl_01h3j4k5l6m7n8p9q0r1s2t3u4",
  "name": "Customer Onboarding",
  "description": "Sends a welcome email and sets up an account.",
  "nodes": [
    {
      "id": "n1",
      "type": "manual_trigger",
      "position": {
        "x": 150,
        "y": 250
      },
      "data": {
        "componentId": "manual_trigger"
      }
    }
  ],
  "edges": [
    {
      "id": "e1-2",
      "source": "n1",
      "target": "n2",
      "sourceHandle": "true"
    }
  ],
  "schedule_type": "manual",
  "schedule_value": "0 9 * * *",
  "next_run_at": "2025-11-01T09:00:00.000000Z",
  "is_active": true,
  "webhook_url": "https://api.altostrat.io/workflows/webhooks/whsec_abc123...",
  "created_at": "2025-10-31T12:00:00.000000Z",
  "updated_at": "2025-10-31T12:30:00.000000Z"
}

Authorizations

Authorization
string
header
required

Standard JWT for user sessions obtained via Altostrat authentication.

Body

application/json
name
string
required

The name for the new workflow.

Example:

"Daily Network Health Check"

authorization_id
string
required

The prefixed ID of the Authorization (auth_...) to use for this workflow's executions.

Example:

"auth_01H..."

nodes
object[]
required

The array of nodes defining the workflow logic.

Minimum length: 1
edges
object[]
required

The array of edges connecting the workflow nodes.

description
string | null

An optional description for the workflow.

is_active
boolean
default:true

Set to false to create the workflow in an inactive state.

schedule_type
enum<string>
default:manual
Available options:
manual,
interval,
cron,
daily,
weekly,
monthly
schedule_value
string | null

Required if schedule_type is interval or cron.

Example:

"0 4 * * *"

Response

The workflow was created successfully.

id
string

The unique prefixed identifier for the workflow.

Example:

"fl_01h3j4k5l6m7n8p9q0r1s2t3u4"

name
string

The human-readable name of the workflow.

Example:

"Customer Onboarding"

description
string | null

A detailed description of what the workflow does.

Example:

"Sends a welcome email and sets up an account."

nodes
object[]

An array of node objects that make up the workflow graph. Only returned when retrieving a single workflow.

edges
object[]

An array of edge objects that connect the nodes in the workflow graph. Only returned when retrieving a single workflow.

schedule_type
enum<string> | null

The type of schedule that triggers the workflow.

Available options:
manual,
interval,
cron,
daily,
weekly,
monthly
Example:

"manual"

schedule_value
string | null

The value for the schedule (e.g., a cron expression or interval string like '5 minutes').

Example:

"0 9 * * *"

next_run_at
string<date-time> | null

The next scheduled time for the workflow to run.

Example:

"2025-11-01T09:00:00.000000Z"

is_active
boolean

Indicates whether the workflow is active and can be triggered.

Example:

true

webhook_url
string<uri> | null

The unique, secure URL to trigger this workflow if it uses a webhook trigger.

Example:

"https://api.altostrat.io/workflows/webhooks/whsec_abc123..."

created_at
string<date-time>

The timestamp when the workflow was created.

Example:

"2025-10-31T12:00:00.000000Z"

updated_at
string<date-time>

The timestamp when the workflow was last updated.

Example:

"2025-10-31T12:30:00.000000Z"