Insert step into a connection
plunk_insert_workflow_stepInsert a step into an existing workflow connection, rewiring A→B to A→new step→B without breaking the graph.
Instructions
Purpose: Add a step in the middle of an existing connection, so A to B becomes A to the new step to B, with both connections rewired for you.
Not for: Adding a step at the end or start of a branch — plunk_add_workflow_step plus plunk_add_workflow_transition is the way to do that.
Returns: The created step including its id.
Use when: Slotting a step into a workflow that already runs. This is safer than deleting a connection and rebuilding it by hand, because the graph is never left broken partway through.
Note: Requires Plunk v0.13+. Plunk validates the resulting connections, so a change that would strand contacts is rejected rather than half-applied.
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. | |
| transitionId | Yes | The connection to insert into. Get it from plunk_get_workflow. |