Skip to main content
Four end-to-end recipes. Each is a full plan plus the curl sequence to create, publish, and run it, with abbreviated responses. Every plan uses real block ids and passes publish validation. For the model behind them, read the guide; for the per-endpoint contract, the interactive Workflows endpoints in the Endpoints section. All examples assume x-api-key: gsk_your_api_key_here and the base URL https://openapi.enginy.ai. The list id 55762, campaign id 8842, and workflow id 4021 are placeholders — resolve real ids with get_lists and get_campaigns.

1. Simplest linear flow

Import a contact list → check email deliverability → add to a campaign. One straight line, no input needed at run time.
1

Create and publish in one call

2

Confirm the run contract

EMPTY means the entry list is baked in — run it with no input.
3

Run it

4

Poll until it finishes

Poll status until it’s a terminal value (SUCCEEDED, FAILED, CANCELLED).

2. Conditional branching

Only campaign the contacts that have an email; send the rest to a review list. A CONDITIONAL node splits the stream. The condition node has one condition and therefore two next slots: the target for the matched condition, then the fallback last.
gate.next has conditions.length + 1 = 2 entries. next[0] (campaign) runs for contacts matching the condition; next[1] (review) is the fallback. Discover valid field / operator values with GET /v1/workflows/condition-fields.
Create it as a draft, validate, then publish:

3. Webhook-triggered workflow with declared inputs

Push a set of contact ids into a workflow from your own system. The WEBHOOK trigger declares a typed input; delivering a payload to the webhook URL starts a run seeded with those contacts.
How declared inputs bind. An entity input type (leadIds or companyIds) seeds the entry block through the "__MANUAL_INPUT" sentinel — set it on the entry step’s entity id, as above. A scalar/array input type instead binds to a specific node field with { "webhookInputKey": "<key>" } in that field’s place.
1

Create and publish

Publishing arms the webhook.
2

Read the live webhook URL

3

Deliver a payload to start a run

Send the declared key (contacts) to the webhook URL:
A webhook trigger that declares inputs can’t be started with POST /v1/workflow/{id}/run (it returns 400) — deliver its payload to the webhook URL instead. Watch executions with GET /v1/workflow/4023/runs.

4. Scheduled workflow

Run a list on a recurring schedule. A SCHEDULE trigger fires the workflow on its own; you never call run.
definition accepts DAILY, WEEKLY, BI_WEEKLY, MONTHLY, QUARTERLY, YEARLY. For finer control (specific weekdays, an end date, or an every-N-periods interval), attach an optional recurrence rule to the trigger. Each scheduled firing appears in GET /v1/workflow/{id}/runs with triggerType: "SCHEDULE".

Patterns worth reusing

Once a workflow exists, PATCH /v1/workflow/{id}/draft with an ops array changes just what you touch — e.g. { "kind": "updateStepInputs", "id": "campaign", "inputs": { "campaignId": 9001, "excludeContactedLeads": true } } — and returns the new revision. Pass that revision on the next write to catch concurrent edits (409).
Set the entry step’s entity input to "__MANUAL_INPUT" (instead of a fixed id). GET then reports runtimeInputContract.status: "SUPPORTED", and you run it with one key from acceptedKeys, e.g. { "input": { "leadIds": [101, 102] } } or { "input": { "contactListId": 55762 } }.
Add "maxCreditsPerRun": 5000 to the create or PATCH …/draft body. Enrichment and AI steps consume credits; a run stops once it reaches the ceiling.

Endpoints

Every request and response shape, generated from the OpenAPI spec.

MCP agent guide

Drive these same flows from an AI agent.