Skip to main content
Create a new workflow from a JSON definition. Returns 201 Created with the new workflow.
Need a starting point? Call Get Example Workflows for validated templates you can copy directly, and List Workflow Actions to discover every action kind and its required inputs.

Overview

The Create Workflow endpoint accepts a workflow definition and stores it under your organisation. New workflows default to DRAFT status and are disabled; publish and enable them when ready to run.

Authentication

Requires a valid API key. No special permission scope is needed beyond a valid key.

Key Features

  • JSON-Defined Pipelines: Build workflows programmatically from action kinds
  • Draft or Published: Start in DRAFT and promote to PUBLISHED when ready
  • Optional Search Binding: Link the workflow to a saved social listening search
  • No Credit Cost: Creating a workflow is free

Workflow Definition Shape

The workflow field is a JSON object with this structure:
KeyTypeRequiredDescription
triggerobjectNoTriggering event. { "kind": "workflows/new-post" | "workflows/engagement" | "workflows/webhook" | "workflows/scheduled-trigger", "inputs": { } }
actionsarrayYesOrdered list of action steps. Each item is { "id": string, "kind": string, "name"?: string, "inputs"?: object }
edgesarrayYesGraph edges connecting actions. Each item is { "from": string, "to": string, "name"?: string, "conditional"?: { "type": "if" | "else" | "match" | "loop" | "completed", "ref": string } }. Use "$source" as from to connect from the trigger
nodesarrayNoOptional canvas annotations (notes/film) — not required for programmatic creation
Action inputs can reference earlier step outputs via {{ !ref($.<id>.result.output) }} or the trigger payload via {{ !ref($.trigger.outputs.<field>) }}.
curl -X POST "https://api.trigify.io/v1/workflows" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Summarise new posts to Slack",
    "description": "AI-summarise each new post and post the summary to Slack",
    "workflow": {
      "trigger": { "kind": "workflows/new-post", "inputs": {} },
      "actions": [
        {
          "id": "agent-1",
          "kind": "generic_agent",
          "name": "Summarise Post",
          "inputs": {
            "outputFormat": "text",
            "model": "openai/gpt-5-mini",
            "prompt": "Summarise this social post in two concise bullet points: {{ !ref($.trigger.outputs.text) }}"
          }
        },
        {
          "id": "slack-1",
          "kind": "slack_send_channel_message",
          "name": "Send Summary",
          "inputs": {
            "channel": "#social-alerts",
            "message": "New post summary: {{ !ref($.agent-1.result.output) }}"
          }
        }
      ],
      "edges": [
        { "from": "$source", "to": "agent-1" },
        { "from": "agent-1", "to": "slack-1" }
      ]
    },
    "enabled": true,
    "status": "PUBLISHED"
  }'

Request Body

FieldTypeRequiredDefaultDescription
namestringYes-Workflow name (1-255 characters)
descriptionstringNo""Free-form workflow description
workflowobjectYes-Workflow definition. See Workflow Definition Shape
search_idstringNo-Saved social listening search ID to link this workflow to. Surfaces on the response as social_saved_search_id
enabledbooleanNofalseWhether the workflow is active and ready to execute
statusstringNo"DRAFT"Workflow status. One of DRAFT or PUBLISHED

Example Response

Returned with HTTP status 201 Created.
{
  "message": "Workflow created successfully",
  "success": true,
  "data": {
    "id": "wf_abc123",
    "name": "Summarise new posts to Slack",
    "description": "AI-summarise each new post and post the summary to Slack",
    "workflow": {
      "trigger": { "kind": "workflows/new-post", "inputs": {} },
      "actions": [
        { "id": "agent-1", "kind": "generic_agent", "name": "Summarise Post", "inputs": { "outputFormat": "text", "model": "openai/gpt-5-mini", "prompt": "Summarise this social post in two concise bullet points: {{ !ref($.trigger.outputs.text) }}" } },
        { "id": "slack-1", "kind": "slack_send_channel_message", "name": "Send Summary", "inputs": { "channel": "#social-alerts", "message": "New post summary: {{ !ref($.agent-1.result.output) }}" } }
      ],
      "edges": [
        { "from": "$source", "to": "agent-1" },
        { "from": "agent-1", "to": "slack-1" }
      ]
    },
    "enabled": true,
    "status": "PUBLISHED",
    "social_saved_search_id": null,
    "created": "2026-04-14T10:00:00.000Z",
    "updated": "2026-04-14T10:00:00.000Z"
  }
}

Response Fields

FieldTypeDescription
messagestringHuman-readable status message
successbooleantrue on success
dataobjectThe created workflow (see below)
The data object contains:
FieldTypeDescription
idstringUnique workflow identifier
namestringWorkflow name
descriptionstringWorkflow description
workflowobjectWorkflow definition (JSON). See Workflow Definition Shape
enabledbooleanWhether the workflow is active
statusstringWorkflow status (DRAFT or PUBLISHED)
social_saved_search_idstring | nullLinked saved search ID, if any (set via search_id on the request)
createdstringISO 8601 creation timestamp
updatedstringISO 8601 last update timestamp

Credit Usage

This endpoint is free and does not consume credits.