The Route From Meta Data job allows you to control the flow of a workflow based on the evaluation of metadata values. It enables conditional branching where different sets of jobs are executed depending on whether specific criteria are met.
Use this job to create flexible, rule-based logic using metadata comparisons, such as executing one path when a status is “OK”, or routing based on time windows.
MetaData Route
Each metadata route compares two values:
- Metadata source – The primary value to evaluate (can be dynamic).
- Compare value – A static value to compare against.
- Compare value source – An alternative to compare against another metadata value (dynamic).
- Compare operator – Defines how the comparison is made.
Operators include equals, greater than, less than, contains, and more. Complete list of operators: Comparison Operators
Routing Example
Assume the workflow contains a metadata key called “status”. If you want the workflow to continue only when the status is “OK”:
- Set Metadata source to {{metadata.status}}
- Set Compare value to OK
- Set Compare operator to =
When this condition is met, the connected jobs on this route will execute. If it doesn’t match, the RouteDestinationOnNoMatch route will be taken.
Date and Time Route
You can also route based on time and date using predefined options:
Route Option | Required Metadata Sources |
---|---|
Open after date | Date source |
Open after time | Time source |
Open before date | Date source |
Open before time | Time source |
Open between date | Date source 1, Date source 2 |
Open between time | Time source 1, Time source 2 |
Closed between date | Date source 1, Date source 2 |
Closed between time | Time source 1, Time source 2 |
- Date without time defaults to 00:00:00.
- Example: yyyy-MM-dd = yyyy-MM-dd 00:00:00
- Between time, when source 1 is after source 2 (e.g., 14:00 – 08:00), is evaluated as two different days:
- Becomes: yyyy-MM-01 14:00:00 to yyyy-MM-02 08:00:00.
Other than searching for a date in a metadata key, for example {{metadata.date_1}}, you can also use the dateTime() function.
Multiple Route Handling
If more than one route condition matches, the workflow will execute jobs from each matching route in order.
Multiple matching routes may lead to complex or unexpected behaviors. Use the “Split on each matching route” option in the job properties if you want each matched route to split into its own job story.
Note: Jobs connected to the “Jobs” output (not part of any route) will not be executed.
How to Use
- Add the Route From Meta Data job to your workflow.
- Create one or more Meta Data Routes with your comparison logic by connecting jobs to each route that should execute if the evaluation matches.
- Optionally, connect jobs to Route Destination On No Match for handling unmatched scenarios.
- Enable split on each matching route if multiple conditions may be true at the same time.
- This is to avoid race-conditions that can occur if two routes are run in the same workflow context.