Skip to main content

Await External Event

ComponentTypeDescription
imgAwait External Event⏸️ pausepause workflow execution and wait for an external event (webhook or API polling) that matches a condition before continuing

The Await External Event component allows you to pause a running workflow and wait for an external event before continuing. Unlike trigger components that start new workflows, this component is used mid-workflow to wait for external systems to signal completion, status changes, or other events.

When to Use

This component is ideal for:

  • Asynchronous Processing: Wait for a long-running external process to complete before continuing
  • Event-Driven Workflows: Pause until an external system sends a webhook notification
  • Polling for Status: Periodically check an external API until a specific condition is met
  • Human-in-the-Loop Integration: Wait for external approval systems to respond

Event Source Modes

The component supports two modes for receiving external events:

Webhook Mode

In webhook mode, the component provides a URL that external systems can POST data to. The component supports two webhook modes:

A static webhook URL is generated when you save the workflow and remains the same across all workflow runs. This allows you to pre-configure the webhook URL in external systems.

Static Webhook URL Format:

https://api.workflow86.com/await_external_event/webhook/{componentId}/{token}

Benefits:

  • URL is immediately available after saving the workflow
  • Can be pre-configured in external systems (CRM, payment gateways, etc.)
  • No need for the workflow to "pass" the URL to external systems

Correlation Field (for concurrent workflows): If multiple workflow sessions may be waiting simultaneously on the same component, you can configure a correlation field. The component will extract this field's value from the webhook payload to match it to the correct waiting session (e.g., order_id, job_id).

Dynamic Webhook

A unique webhook URL is generated for each workflow session when it reaches this component. Use this when you need the workflow to explicitly pass the callback URL to an external system.

Dynamic Webhook URL Format:

https://api.workflow86.com/await_external_event/webhook/{sessionToken}

When to use:

  • When you want complete isolation between workflow sessions
  • When the external system expects the callback URL to be provided as part of the request

When the workflow reaches this component:

  1. A unique webhook token is generated for this specific workflow session
  2. The workflow pauses (enters WAITING state)
  3. The webhook URL is available as a placeholder for subsequent components to use
  4. External systems can POST data to the webhook URL
  5. When data is received and the condition is met, the workflow resumes

API Polling Mode

In polling mode, the component periodically polls an external API endpoint and checks if the response matches a configured condition:

  1. The workflow pauses (enters WAITING state)
  2. The component polls the configured API at regular intervals
  3. Each response is evaluated against the condition
  4. When a response matches the condition, the workflow resumes

Configuration

Event Source

Select how the component should receive external events:

  • Webhook - External systems POST data to a unique endpoint
  • API Polling - Component polls an external API at intervals

Webhook Configuration

Webhook Mode Selection

Choose between Static URL and Dynamic URL based on your use case:

ModeURL GenerationBest For
Static URLGenerated when workflow is savedPre-configuring external integrations, payment webhooks, CRM callbacks
Dynamic URLGenerated per workflow sessionWhen workflow explicitly passes callback URL to external systems

Static Webhook Configuration

  1. Save the workflow to generate your static webhook URL
  2. Copy the URL from the component configuration panel
  3. Configure this URL in your external system
  4. (Optional) Set a Correlation Field if multiple workflows may wait simultaneously
Static Webhook URL

The static webhook URL is stable - you only need to configure it once in your external system. It will work for all future workflow runs.

Dynamic Webhook Configuration

The dynamic webhook URL is available as a placeholder when the workflow reaches this component. Use it in subsequent components (like API Request or Email) to send the callback URL to external systems.

Dynamic Webhook URL Availability

With dynamic mode, the webhook URL is only available when a workflow session is actively waiting at this component. Each workflow session gets a unique token.

API Polling Configuration

When using polling mode, configure the following:

API Endpoint URL

Enter the URL of the API endpoint to poll. You can use placeholders for dynamic values, including:

  • Secrets: Type $ to insert secrets stored in your credential store (e.g., ${API_KEY.SECRET})
  • Placeholders: Insert values from previous components in the workflow

HTTP Method

Select the HTTP method to use for polling:

  • GET - Retrieve data from the endpoint (default)
  • POST - Send data to the endpoint
  • PUT - Update data at the endpoint
  • DELETE - Delete data at the endpoint

Headers

Add custom HTTP headers to include with each poll request. Click the + button to add key-value pairs. Header values support placeholders and secrets.

Query Parameters

Add URL query parameters to include with each poll request. Click the + button to add key-value pairs.

Request Body

For POST and PUT requests, enter the request body content. You can include placeholders and secrets.

Polling Interval

Configure how often the API should be polled while waiting:

  • Interval Value - The number of time units between polls (minimum: 1)
  • Interval Type - Minutes, Hours, or Days

Response Format

Select the expected response format:

  • JSON - Parse response as JSON (default)
  • XML - Parse response as XML
  • Plain Text - Treat response as plain text

Resume Condition

Configure the condition that must be met for the workflow to resume. The condition evaluates the incoming data (webhook payload or API response) and resumes when matched.

Condition Type

Select the type of condition to use:

TypeDescriptionUse Case
Field PathSimple dot notation (e.g., data.status)Most common - accessing specific fields in JSON
JSONPathJSONPath expression (e.g., $.data.items[*].status)Complex JSON navigation, arrays, filtering
RegexMatch a regex pattern against the entire responsePattern matching across the whole response
Text SearchSearch for text with AND/OR logicFinding specific text combinations anywhere in response

Field Path / JSONPath / Regex Expression

Enter the expression based on your selected condition type:

Field Path examples:

  • status - Top-level field
  • data.state - Nested field
  • result.items[0].completed - Array access with nested field

JSONPath examples:

  • $.status - Top-level field
  • $.data.items[*].status - All status fields in items array
  • $.data.items[?(@.active==true)].id - IDs of active items

Regex examples:

  • "status":\s*"completed" - Match status field with completed value
  • error|failed|timeout - Match any error-related text

Operator

Select the comparison operator:

OperatorDescription
EqualsField value exactly matches expected value
Not equalsField value does not match expected value
ContainsField value contains expected value as substring
Does not containField value does not contain expected value
Starts withField value starts with expected value
Ends withField value ends with expected value
Greater thanField value is numerically greater than expected
Less thanField value is numerically less than expected
Greater than or equalsField value is greater than or equal to expected
Less than or equalsField value is less than or equal to expected
Matches regexField value matches a regular expression pattern
In listField value matches one of the comma-separated values
Not in listField value does not match any of the comma-separated values
Is emptyField value is null, undefined, or empty string
Is not emptyField value exists and is not empty
ExistsField exists in the data (regardless of value)
Does not existField does not exist in the data

Expected Value

Enter the value to compare against (not required for operators like "is empty", "exists", etc.).

For In list and Not in list operators, enter comma-separated values: completed, done, finished

Example Conditions:

ScenarioTypeExpressionOperatorExpected Value
Wait for status "completed"Field PathstatusEqualscompleted
Wait for progress >= 100Field PathprogressGreater than or equals100
Wait for any success statusField PathstatusIn listcompleted, done, success
Wait for error field to be emptyField PatherrorIs empty(none)
Wait for completed pattern in responseRegex"status":\s*"completed"Matches regex(pattern in expression)
Wait for any item to be readyJSONPath$.items[*].readyEqualstrue

Text Search Conditions

When using Text Search condition type, you can define multiple search rules with AND/OR logic:

  1. Click Add Rule to add a search condition
  2. For each rule, configure:
    • Contains / Does NOT contain - Whether the text should or shouldn't be present
    • Case sensitive - Enable for case-sensitive matching
    • Search text - The text to search for (supports placeholders)
  3. Use the connector button between rules to toggle between AND (all rules must match) and OR (any rule in the group can match)

Text Search Examples:

ScenarioRules
Wait for "success" anywhereContains: success
Wait for "completed" but not "error"Contains: completed AND Does NOT contain: error
Wait for "approved" or "accepted"Contains: approved OR Contains: accepted
Empty Condition

If you leave the condition empty (no expression specified), the workflow will resume on any incoming event.

Timeout Configuration (Optional)

Enable timeout to set a maximum wait time. If the condition is not met before the timeout:

Timeout Duration

Set the maximum time to wait:

  • Value - Number of time units
  • Type - Minutes, Hours, or Days

Timeout Behavior

Choose what happens when the timeout is reached:

  • Error - Fail the workflow with a timeout error
  • Continue - Complete successfully with a timeout flag (the output will indicate a timeout occurred)

Output Placeholder

Configure the placeholder key where the event data will be stored. When the workflow resumes, the data from the event that triggered the resume (webhook payload or API response) is stored in this placeholder as JSON.

Session Status

The component UI displays information about active waiting sessions:

  • Active sessions: How many workflow sessions are currently waiting at this component
  • Session details: Session ID, event source mode, and waiting status
  • Webhook URL: For active webhook mode sessions, the webhook URL is displayed with a copy button

Use the Refresh button to update the session information.

How It Works

Execution Flow

Workflow starts

Previous components execute

Await External Event reached

Session enters WAITING state

[Webhook Mode] [Polling Mode]
Wait for POST ←────────or────────→ Poll API at intervals
↓ ↓
Evaluate condition ←──────────────→ Evaluate condition
↓ ↓
←───────── Condition met? ─────────→
No (wait for next) Yes (resume)

Session enters SUCCESS state

Subsequent components execute

Timeout Flow

If timeout is configured and reached before the condition is met:

Timeout reached

[Error behavior] [Continue behavior]
↓ ↓
Session FAIL Session SUCCESS
Workflow stops Output includes timeout=true
Workflow continues

Best Practices

  1. Use meaningful conditions - Design conditions that clearly indicate when it's appropriate to resume. Avoid overly broad conditions that might match unintended events.

  2. Set appropriate timeouts - Always consider adding a timeout for production workflows. This prevents workflows from waiting indefinitely if the expected event never arrives.

  3. Secure webhook endpoints - While webhook tokens are random and unique per session, consider the security implications of your webhook endpoints and what data is transmitted.

  4. Monitor active sessions - Use the session status in the component UI to monitor waiting sessions. Many long-waiting sessions might indicate a configuration issue.

  5. Handle timeouts gracefully - If using "Continue" timeout behavior, design your subsequent workflow logic to check for and handle the timeout condition appropriately.

  6. Use polling intervals wisely - When using polling mode, balance responsiveness with API load. More frequent polling means faster detection but more API calls.

  7. Store API secrets securely - Use the credential store for API keys and tokens. Never hardcode sensitive values in the component configuration.

  8. Choose the right condition type - Use Field Path for simple JSON fields, JSONPath for complex nested data or arrays, Regex for pattern matching, and Text Search when you need to find text anywhere in the response with flexible AND/OR logic.

  9. Use In list for multiple valid values - Instead of creating complex OR conditions, use the "In list" operator when waiting for any of several acceptable values (e.g., completed, done, finished).

  10. Test regex patterns - When using regex conditions, test your patterns against sample data before deploying. Remember to escape special regex characters like ., *, ?, etc.

Troubleshooting

IssuePossible CauseSolution
Workflow not resumingCondition not matchingCheck the condition configuration; verify the field path/expression is correct
Webhook not receivedWrong URL or tokenVerify the webhook URL is correct and the token hasn't expired
Polling not workingAPI returning errorsCheck poll history for error messages; verify credentials
Session stuck waitingNo events receivedCheck if external system is configured correctly; verify timeout settings
Wrong data in outputResponse format mismatchChange the response format setting (JSON/XML/Text)
Timeout not triggeringTimeout not enabledEnable timeout in the configuration
JSONPath not matchingInvalid JSONPath syntaxVerify JSONPath expression; ensure it starts with $
Regex not matchingPattern syntax errorTest your regex pattern; escape special characters properly
Text search not finding textCase sensitivityTry disabling case-sensitive matching; check for extra whitespace
In list operator not matchingWhitespace in valuesEnsure no extra spaces around comma-separated values

Example Use Cases

Wait for External Approval

A workflow that sends a request for approval to an external system and waits for the response:

  1. Previous component sends approval request to external system (with webhook callback URL)
  2. Await External Event (webhook mode) waits for approval response
  3. Condition: approved equals true
  4. Next component processes based on approval status

Poll for Job Completion

A workflow that starts a long-running job and polls for completion:

  1. Previous component starts a job via API, receives job ID
  2. Await External Event (polling mode) polls job status endpoint
  3. Condition: status equals completed
  4. Timeout: 1 hour with error behavior
  5. Next component retrieves job results

Wait for Payment Confirmation

A workflow that processes orders and waits for payment:

  1. Previous component creates order and sends payment request
  2. Await External Event (webhook mode) waits for payment webhook
  3. Condition: payment.status equals successful
  4. Timeout: 24 hours with continue behavior
  5. Next component handles successful payment or timeout