Add workflow step
plunk_add_workflow_stepAdd a workflow step to send email, wait, branch, call a webhook, or update contacts. Create the step before wiring transitions.
Instructions
Purpose: Add a step to a workflow — send an email, wait, branch on a condition, call a webhook, or update the contact.
Not for: Slotting a step between two that are already connected — plunk_insert_workflow_step does that in one call and rewires both sides. A step added here is orphaned until plunk_add_workflow_transition wires it in.
Returns: The created step including its id, needed for transitions.
Use when: Building out what an automation does, one step at a time.
Note: DELAY is capped at 365 days. WEBHOOK url, headers and body interpolate template variables on v0.12+. UPDATE_CONTACT accepts subscriptionAction to change subscription state as part of the step.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Workflow UUID | |
| name | Yes | ||
| type | Yes | Step type. TRIGGER = entry point (auto-created with workflow). SEND_EMAIL = send a templated email. DELAY = wait X time. WAIT_FOR_EVENT = wait for a specific event with timeout. CONDITION = if/else branching. EXIT = early exit. WEBHOOK = call an external URL. UPDATE_CONTACT = update contact fields. | |
| config | Yes | Step-type-specific config. SEND_EMAIL: { templateId, recipient: { type: 'CONTACT' | 'CUSTOM', customEmail? } }. DELAY: { amount, unit: 'minutes'|'hours'|'days' } (max 365 days). WAIT_FOR_EVENT: { eventName, timeout? }. CONDITION: { field, operator, value? } or multi-branch shape. WEBHOOK: { url, method, headers?, body? } — url/headers/body support template variable interpolation (e.g. {{contact.email}}) on v0.12+. UPDATE_CONTACT: { updates?: {...}, subscriptionAction?: 'none'|'subscribe'|'unsubscribe' } — subscriptionAction lets a workflow change subscription state; at least one of updates or subscriptionAction is required. | |
| position | Yes | UI position (e.g. {x, y}) | |
| templateId | No | Email template UUID, for SEND_EMAIL steps. | |
| autoConnect | No |