Martini Workflows Wait For Event Node
Overview
The Wait For Event Node allows you to pause workflow processing and wait for a specific event before it continues. This node helps you control workflow timing and coordinate event-driven operations within your Martini workflows.
What You Will Learn
- How to add Wait For Event Nodes to workflows
- How to configure event-driven delays and timeout handling
- How to map event properties to workflow data
- When to use event-based coordination in automation
When To Use This
Use this when you need to:
- Wait for external system notifications before continuing workflow execution
- Create event-driven automation that responds to real-time data changes
- Implement approval workflows that pause until user action occurs
Prerequisites
- Martini Designer installed and running on your system
- Create a Martini Package
- Create a Workflow
- Parts of a workflow
- Basic understanding of how to use Workflow Designer
Adding Wait For Event Nodes to Workflows
Add a Wait For Event Node to pause workflow execution until your specified event occurs:
- Navigate to your Martini Package and open your workflow.
- Click the Add Node button in the toolbar on the top left of the Workflow Designer.
- Select Wait For Event from the available node types.
- Drag the Wait For Event Node to your desired position in the workflow canvas.
Expected result: The Wait For Event Node is now integrated into your workflow and ready for configuration. Continue to Configuring Wait For Event Nodes to set up your event and delay parameters.
Configuring Wait For Event Nodes
Configure your Wait For Event Node to control when workflow execution resumes and how event data flows into your workflow.
Getting Started with Event Configuration
- Click the expand icon () on your Wait For Event Node to open the Wait For Event Panel.
- Event Name: Enter the name of the event to receive that will trigger continuation of the workflow. Ensure that the name matches the expected event in case-sensitive format.
Example configuration:
1 | |
Expected result: Your node is now configured to monitor for the order-payment-confirmed event and will pause workflow execution until this event is received.
What happens next:
- Your Wait For Event Node is now configured with basic event monitoring.
- To handle cases where events don't arrive during your expected duration and an infinite workflow wait time, you can configure a Max Wait Time and connect timeout logic to your Wait for Event node (see Configuring Max Wait Time and Adding Timeout Logic).
- If your event contains data you need in your workflow like user information or order details, configure data mapping to transfer event properties into workflow variables (see Wait For Event Data Mapping Configuration).
- After handling timeouts and data mapping as needed, add the workflow nodes that should execute after receiving your event such as data processing, API calls, or notifications by browsing available node types in Workflow Nodes and connecting them using workflow edges.
- For simple event waiting without timeout handling or data mapping, connect your Wait For Event Node directly to your next workflow logic using workflow edges.
Configuring Max Wait Time and Adding Timeout Logic
Configure maximum wait duration and timeout behavior to prevent workflows from waiting indefinitely:
- Max Wait Time: Optional. Enter the numeric duration value in the Max Wait Time input box.
-
Select your preferred time unit from the dropdown:
- Seconds - For short delays (1-59 seconds)
- Minutes - For moderate delays (1-59 minutes)
- Hours - For extended delays (1-23 hours)
- Days - For long-term delays (1+ days)
Expected result: The Wait For Event Node now includes timeout protection. If you set a Max Wait Time, a Timeout edge handle () appears for connecting timeout logic.
Adding Timeout Logic
Upon setting a max wait time, you'll see a new edge handle () labeled Timeout:
- Add your timeout logic: Create workflow nodes that should execute when max time is reached. This could include retry logic, error logging, or cleanup operations.
- Link your Wait For Event Node's
Timeoutedge to the first node of your timeout logic by creating workflow edges.
Expected result: Your workflow now handles both successful event reception and timeout scenarios, ensuring reliable execution regardless of external system behavior.
Wait For Event Data Mapping Configuration
Map properties from received events into your workflow variables for processing and decision-making.
Understanding Event Data Mapping Panel Layout
The Event Data Mapping Panel uses Martini's standard Data Mapper Panel with the Simple Mapper Layout to transform data within your workflow.
This panel is organized into two main sections for event data handling:
1 2 3 4 | |
- Event Output Properties (left): Available properties from your event payload. You must manually declare these properties using the Declare Property option, and their names must match your expected event payload structure exactly (case-sensitive). See Mapping Event Properties to Workflow Properties for detailed steps on declaring and matching properties.
- Mapping Lines (middle): Visual connectors showing data flow from event to workflow.
- Workflow Input Properties (right): Available workflow properties including inputs, outputs, and variables from current and previous nodes.
Mapping Event Properties to Workflow Properties
Configure data transfer from received events into your workflow:
- Click the expand icon () on your Wait For Event Node to open the Wait For Event Panel.
- Ensure you've configured the event name and max wait time as described in previous sections.
-
Click the Declare Property option to add a new event output property.
Important: Ensure property names match the event payload structure exactly.
Example event payload:
1 2 3 4
{ "firstName": "Zeron", "lastName": "Gesicht" }Your Event Output properties must be named
firstNameandlastNameexactly to match this payload structure. -
Map event output properties to workflow properties using the visual mapping interface or expressions.
Learn More About Data Mapping
For detailed information about mapping properties, creating set expressions, and advanced data transformation techniques, see Data Mapping. This comprehensive guide covers map lines, set expressions, and working with complex data structures.
Expected result: When your workflow receives the specified event, property values automatically transfer from the event payload into your workflow variables for use in subsequent processing.
Wait For Event Node Key Terms
Important terminology for understanding event-driven workflow control:
| Term | Definition |
|---|---|
| Event Name | The unique identifier of the event your workflow waits to receive before continuing execution |
| Max Wait Time | Optional timeout duration that limits how long the workflow waits for an event before triggering timeout logic |
| Event Payload | Data contained within the received event that can be mapped to workflow properties |
| Timeout Edge | Connection point that executes alternative logic when max wait time is exceeded |
| Event Data Mapping | Process of transferring properties from received events into workflow variables |
How Wait For Event Node Execution Works
Wait For Event Nodes integrate with Martini's workflow execution engine to provide precise event-driven control:
Event-Driven Execution Process:
- Node Activation: Workflow reaches the Wait For Event Node during normal execution
- Event Monitoring: Workflow pauses and begins monitoring for the specified event name
- Timer Initialization: If Max Wait Time is configured, countdown timer starts tracking elapsed time
- Event Reception Path: When the specified event is received, workflow continues through the main execution path
- Timeout Path: If max time is reached without receiving the event, workflow executes nodes connected to the Timeout edge
- Data Integration: Event payload properties are automatically mapped to workflow variables if configured
- Execution Resumption: Workflow proceeds with full context preserved and event data available
This process enables sophisticated event-driven automation while maintaining workflow reliability through timeout handling.
Testing your Wait Event Node
Once your workflow is waiting for an event, you can quickly test your Wait For Event Node configuration or trigger continuation in production by sending the specified event. This is especially useful for verifying that your event names, data mapping, and timeout logic work as expected before deploying your workflow.
Sending Events from Martini Designer
For testing and development, send events directly from the Designer interface:
- Locate your running workflow with an active Wait For Event Node in the Workflow Designer.
- Right-click on the Wait For Event Node that is currently waiting for an event.
- Select "Send Workflow Event" from the context menu.
- Configure the event in the Send Workflow Event dialog:
- Event Name: The event name field will automatically show the name from your Wait For Event Node configuration. You can change this if needed, but it must match exactly for the event to be received.
- Event Model Data: If you configured data mapping in your Wait For Event Node, the dialog will show input fields for each property you defined. Fill in these fields with the test data you want to send.
- Click Send to trigger the event.
Expected Result: The workflow immediately continues execution, processing the provided event data according to your configured mappings.
Note: You can send the same event multiple times for testing different scenarios or data variations.
Sending Events via REST API
For programmatic integration and production systems, use Martini's REST API endpoints:
Test API Calls Directly in Martini Designer
You can test these API requests without switching to external tools by using Martini Designer's built-in HTTP Client. This lets you quickly verify your event API calls during development. Learn more: Creating and Sending Requests in HTTP Client
Common Request Parameters:
- event: The event name that matches your Wait For Event Node configuration
- eventModel: JSON object containing the event payload data with values for the input properties you declared in the Wait Event Node's data mapper panel (if data mapping is configured)
Send Event to Specific Running Workflow
1 2 3 4 5 6 7 8 9 10 11 | |
- {id}: Replace with the specific running workflow instance ID
Send Event to All Matching Workflows
1 2 3 4 5 6 7 8 9 10 11 | |
This endpoint sends the event to any currently running workflows that have Wait For Event Nodes configured with the matching event name.
Expected Result: All workflows waiting for the specified event name receive the event and continue execution with the provided data.
Wait For Event Node Benefits and Use Cases
Event-driven workflow control solves coordination challenges in complex automation scenarios. By waiting for specific events, you can synchronize multiple systems, handle asynchronous operations, and create responsive automation that adapts to real-time conditions.
Common implementation scenarios include approval workflows that pause for user decisions, data processing pipelines that wait for external system notifications, and integration workflows that coordinate multiple service interactions.
Wait For Event Troubleshooting
| Problem | Detection | Cause | Fix |
|---|---|---|---|
| Workflow never resumes | No output or execution stops unexpectedly | Event not received and no timeout configured | Add max wait time and timeout logic as described in Timeout Management. Include debug logging in timeout logic to investigate event reception issues. |
| Event data not available | Workflow properties remain empty after event | Property names don't match event payload structure | Verify Event Output property names exactly match event payload field names (case-sensitive). Check event payload format in system logs. |
| Timeout triggers immediately | Timeout logic executes without waiting | Max wait time set to invalid value | Verify numeric wait time value is positive and time unit is properly selected. Minimum wait time is 1 second. |
Helpful Resources
- Workflow Designer Guide - Comprehensive guide to building and managing workflows
- Workflow Nodes - Complete reference for all available workflow node types
- Wait for Time Node - Pause workflow execution for a specific duration
- Workflow Concepts - Understanding workflow fundamentals and execution models
- Community Q&A: Martini Community
Have a Question? Post or search it here.