Managing Arguments
Arguments are used to pass data from one workflow file to another. They are essential for building modular, reusable automations. While they function similarly to variables—storing data and having static types—they differ in their ability to cross the boundaries of individual flow files.
🌉 Variables vs. Arguments
| Feature | Variables | Arguments |
|---|---|---|
| Reach | Local to a specific flow/sequence. | Can be passed between external services and flows. |
| Scope | Defined by containers (Sets). | Effectively global across the invoked files. |
| Direction | No direction; they just exist. | Must have a direction (In, Out, InOut). |
🧭 Argument Directions
The direction of an argument determines how the data is handled during the execution of the workflow.
In
The argument is received from an external service or parent workflow. It is an input-only value that cannot be returned or updated in the calling workflow after execution.
Out
The argument acts as an output. It calculates or stores a value within the workflow and returns it to the external service or parent workflow once execution is complete.
In/Out
A bi-directional argument. It can receive an initial input value, be modified during the execution of the workflow, and then return the updated value back to the caller.
Property
A specialized version of an In/Out argument that supports a Default Value. Properties are often used when an argument needs to maintain a standard value unless explicitly overridden by the caller.
🛠️ Working with Arguments
Creating Arguments
Arguments are managed in the Arguments tab of the Data Manager (next to the Variables tab).
- Name: We recommend a clear naming convention (e.g.,
in_CustomerNameorout_TotalAmount). - Direction: Select In, Out, InOut, or Property.
- Type: Arguments are Statically Typed. Ensure the type matches the data being passed.
- IsRequired: If checked, the workflow will throw an error if this argument is not provided an "In" value or a default value.
Setting Default Values
Both variables and arguments can have a Default Value. This value is assigned automatically if no other value is provided during the execution of the sequence. This is particularly useful for testing workflows independently of their parent callers.
💡 Best Practices
- Naming Conventions: Always prefix your arguments (e.g.,
in_,out_,io_) to distinguish them from local variables at a glance. - Variable Priority: If a variable and an argument share the exact same name, the Variable takes precedence at runtime.
- Global Reach: Arguments passed into a sequence remain valid within the outer sequence, providing a more "global" reach compared to the strict set-based scope of variables.
Next Steps:
- Learn how to invoke workflows using Invoke Flow Activity.
- Deep dive into complex Data Types for arguments.