Workflows

Create automated email sequences triggered by events or API calls.

Workflows allow you to build automated email sequences that respond to subscriber actions. Each workflow consists of triggers, conditions, and actions that execute in sequence.

API Endpoints

MethodEndpointDescription
GET/api/v1/workflowsList all workflows
POST/api/v1/workflowsCreate a new workflow
GET/api/v1/workflows/:idGet workflow details
PUT/api/v1/workflows/:idUpdate a workflow
DELETE/api/v1/workflows/:idDelete a workflow
POST/api/v1/workflows/:id/activateActivate a workflow
POST/api/v1/workflows/:id/pausePause a workflow

Trigger Types

Workflows can be triggered by various events or manually via the API.

api

Triggered manually via API call

subscriber.created

When a new subscriber is added

subscriber.updated

When subscriber data changes

email.opened

When a recipient opens an email

email.clicked

When a recipient clicks a link

List Workflows

Retrieve all workflows for your organization with optional filtering.

# List all workflows
curl -X GET https://api.sendmailos.com/api/v1/workflows \
  -H "Authorization: Bearer sk_live_..."
// Response
{
  "success": true,
  "workflows": [
    {
      "id": "wf_abc123",
      "name": "Welcome Series",
      "status": "active",
      "triggerConfig": { "type": "subscriber.created" },
      "stats": {
        "totalRuns": 1250,
        "activeRuns": 42,
        "completedRuns": 1208
      }
    }
  ]
}

Create Workflow

Create a new workflow with a name and optional trigger configuration.

Request Body
Parameters for creating a workflow
nameRequired - Workflow name
triggerOptional - Trigger configuration
trigger.typeTrigger type (default: "api")
workspace_idOptional - Associate with workspace
# Create a workflow
curl -X POST https://api.sendmailos.com/api/v1/workflows \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Welcome Series",
    "trigger": {
      "type": "subscriber.created"
    }
  }'

Activate & Pause

Control workflow execution by activating or pausing workflows.

Activate
Start processing triggers
POST /api/v1/workflows/:id/activate
Pause
Stop processing new triggers
POST /api/v1/workflows/:id/pause
# Activate a workflow
curl -X POST https://api.sendmailos.com/api/v1/workflows/wf_abc123/activate \
  -H "Authorization: Bearer sk_live_..."

# Pause a workflow
curl -X POST https://api.sendmailos.com/api/v1/workflows/wf_abc123/pause \
  -H "Authorization: Bearer sk_live_..."

Update Workflow

Update workflow properties including name, nodes, edges, and trigger configuration.

Request Body
All fields are optional - only include what you want to update
nameWorkflow name
nodesArray of workflow nodes
edgesArray of node connections
triggerTrigger configuration
# Update workflow name and trigger
curl -X PUT https://api.sendmailos.com/api/v1/workflows/wf_abc123 \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Welcome Series",
    "trigger": {
      "type": "subscriber.created",
      "conditions": { "tags": ["premium"] }
    }
  }'

Delete Workflow

Permanently delete a workflow. This action cannot be undone.

Warning: Deleting a workflow will stop all active executions and remove all historical data. Consider pausing the workflow instead if you may need it later.

# Delete a workflow
curl -X DELETE https://api.sendmailos.com/api/v1/workflows/wf_abc123 \
  -H "Authorization: Bearer sk_live_..."
// Response
{
  "success": true,
  "message": "Workflow deleted"
}

Workflow Statuses

draft

Workflow is being configured, not yet activated

active

Workflow is live and processing triggers

paused

Workflow is paused, no new executions will start