Martini Workflows Wait For Time Node
Overview
The Wait For Time Node adds configurable delays to your workflow execution, allowing you to pause processing for a specific duration or until a particular date and time. This node helps you control workflow timing and coordinate time-sensitive operations within your Martini workflows.
What You Will Learn
- How to add Wait For Time Nodes to workflows
- How to configure duration-based and date-time-based delays
- When to use timing controls for optimal workflow performance
- How to implement dynamic scheduling with script expressions
When To Use This
Use the Wait For Time Node when you need to:
- Control operation frequency to prevent overwhelming external APIs or shared resources
- Enforce timing requirements for compliance processes, approval workflows, or business rules
- Coordinate system integration by waiting for data synchronization or dependent service availability
- Implement retry strategies with delays before retrying failed operations or after security events
- Schedule business-hour processing by waiting until appropriate times for critical operations
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 Time Nodes to Workflows
The Wait For Time Node provides flexible timing controls for workflow execution management.
- 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 Time from the available node types.
- Drag the Wait For Time Node to your desired position in the workflow canvas.
- Add your post-delay logic: Create the workflow nodes that should execute after the wait period . See All Workflow Nodes.
- Connect the timing flow: Link your Wait For Time Node to the first node of your post-delay logic by creating workflow edges.
Expected result: The Wait For Time Node is now integrated into your workflow and ready for timing configuration. Continue to Configuring The Wait For Time Node to set up your delay parameters.
Configuring The Wait For Time Node
Configure your Wait For Time Node to control when workflow execution resumes:
- Click the expand icon on your Wait For Time Node to open the Wait for Time Panel.
-
Select your preferred timing method from the Wait For dropdown:
- Duration - Set a fixed time period (30 seconds, 5 minutes, 2 hours, etc.). See Duration-Based Wait Configuration.
- Date Expression - Schedule resumption at a specific date and time by entering a script or plain text. See Date Expression-Based Wait Configuration.
-
Configure the timing details based on your selected method.
Expected result: Your workflow will pause according to your timing configuration before continuing to the next node.
The Wait For Time Node offers two distinct timing approaches to match different workflow requirements.
Duration-Based Wait Configuration
Use duration-based configuration for consistent, predictable delays in your workflow execution.
Setting Up Duration Delays
Configure fixed time delays using standard time units:
- In the Wait for Time Panel, select Duration from the Wait For dropdown.
- Enter the numeric duration value in the Duration 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: Workflow execution pauses for the specified duration before automatically continuing.
Duration Configuration Benefits and Use Cases
Duration-based delays provide predictable timing control for various scenarios:
- API rate limiting: Prevent overwhelming external services with consistent request spacing
- Batch processing: Allow time for system resources to recover between operations
- System integration: Provide buffer time for external systems to process data
Date Expression-Based Wait Configuration
Use date expression configuration for precise scheduling and business-hour coordination. There are two ways to configure date expressions:
- Exact Date-Time: Enter a specific date and time in standard format. See Setting Up Exact Date-Time Waits.
- Dynamic Date-Time: Use script expressions for intelligent, condition-based scheduling. See Dynamic Date-Time Configuration with Scripts.
Setting Up Exact Date-Time Waits
Configure workflow continuation at specific moments using standard date-time formats:
- In the Wait for Time Panel, select Date Expression from the Wait For dropdown.
-
Enter the exact date-time in the format
YYYY-MM-DDTHH:MM:SS:- YYYY = Year (2025)
- MM = Month (01-12)
- DD = Day (01-31)
- HH = Hour (00-23)
- MM = Minutes (00-59)
- SS = Seconds (00-59)
Example: 2025-12-15T09:30:00 resumes workflow execution on December 15, 2025, at 9:30 AM.
Expected Result: Workflow execution pauses until the specified date and time is reached.
Dynamic Date-Time Configuration with Scripts
Create flexible timing logic that adapts to business rules and conditions:
- In the Wait for Time Panel, select Date Expression from the Wait For dropdown.
- Click the on the top right of the panel to select your script language.
- Choose from available scripting languages
- Enter your script ensuring it returns a DateTime object.
Dynamic Scheduling Script Examples
A script that automatically schedules workflow continuation during business hours, avoiding weekends and after-hours processing (Groovy):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | |
Expected Result: Workflow automatically schedules continuation during business hours, preventing weekend or after-hours processing.
Dynamic Scheduling Supported Languages
Martini supports multiple scripting languages for flexible timing logic:
- Groovy (default)
- Shell Script (Linux/macOS), or Batch (Windows)
- Python (option appears if installed)
- JavaScript (option appears if installed)
Dynamic Scheduling Benefits and Use Cases
Script-based timing provides intelligent workflow coordination:
- Business rule compliance: Automatically respect operating hours and holidays
- Resource optimization: Schedule processing during low-usage periods
- Integration coordination: Sync with external system maintenance windows
- Conditional delays: Implement complex timing logic based on workflow context
How Wait For Time Nodes Work
Wait For Time Nodes integrate seamlessly with Martini's workflow execution engine to provide precise timing control.
Execution Flow Process:
- Node Activation: Workflow reaches the Wait For Time Node during normal execution
- Timer Initialization: Node calculates the target continuation time based on configuration
- Execution Suspension: Workflow pauses processing for the configured duration.
- Automatic Resumption: When the time condition is met, workflow execution continues automatically
- Next Node Processing: Workflow proceeds to the subsequent node with full context preserved
Restart Resilience:
Wait For Time Nodes continue waiting even if Martini is restarted. When you restart Martini while a workflow is waiting, the node retains its wait condition and target time, ensuring the workflow resumes at the correct moment after Martini starts back up.
Troubleshooting Wait Time Issues
| Problem | Detection | Cause | Fix |
|---|---|---|---|
| Workflow never resumes | No output or unexpected output. | Invalid date format in Date Expression | Verify date format is YYYY-MM-DDTHH:MM:SS or script returns valid DateTime |
| Script execution error | Error logs show script compilation failure | Syntax errors in dynamic date-time script | Check script syntax and ensure DateTime return type |
| Unexpected immediate continuation | Workflow skips wait period | Date-time expression resolves to past time | Ensure target date-time is in the future or script logic is correct |
Helpful Resources
- Workflow Designer Guide - Comprehensive guide to building and managing workflows
- Workflow Nodes
- Workflow Concepts - Understanding workflow fundamentals and execution models
- Community Q&A: Martini Community
Have a Question? Post or search it here.