Overview
Workflows use parameters for inputs and context for passing data between blocks. This enables dynamic, reusable workflows that can process different data on each run.Parameter Types
Workflow parameters are declared inworkflow_definition.parameters and have two main categories:
1. Workflow Parameters (Inputs)
These are the values you pass when running a workflow. Each parameter requires:key: The name used to reference this parameterparameter_type: Always"workflow"for input parametersworkflow_parameter_type: The data type
workflow_parameter_type values:
| Type | Description | Example Value |
|---|---|---|
string | Text value | "John Smith" |
integer | Whole number | 42 |
float | Decimal number | 99.99 |
boolean | True or false | true |
json | JSON object or array | {"key": "value"} or ["a", "b"] |
file_url | URL to a file | "https://example.com/resume.pdf" |
credential_id | Reference to stored credential | "cred_abc123" |
2. Context Parameters
Context parameters reference outputs from other parameters or blocks. Useparameter_type: "context":
user_info.email and makes it available as {{user_email}}.
3. Output Parameters
Output parameters collect results from the workflow. Useparameter_type: "output":
Using Parameters in Blocks
Reference parameters using Jinja2 template syntax:{{ parameter_key }}.
Simple Reference
Nested Fields
Access nested fields with dot notation:Array Iteration
Access array elements by index:Passing Data Between Blocks
Each block produces an output that becomes available to subsequent blocks. Reference block outputs using{{ label_output }}.
Basic Example
extract_order_id block produces:
download_invoice block accesses this as {{ extract_order_id_output.order_id }}.
Complex Data Flow
Parameter Scoping with parameter_keys
By default, blocks have access to all workflow parameters and previous block outputs. Use parameter_keys to explicitly declare which parameters a block can access:
- Security: Limit credential access to specific blocks
- Clarity: Make dependencies explicit
- Debugging: Easier to trace parameter usage
Loop Context
Inside afor_loop block, access the current iteration value using {{ nested_block_label.current_value }}.
Basic Loop
order_ids: ["ORD-001", "ORD-002", "ORD-003"], the loop executes three times:
- Iteration 1:
{{ download_invoice.current_value }}="ORD-001" - Iteration 2:
{{ download_invoice.current_value }}="ORD-002" - Iteration 3:
{{ download_invoice.current_value }}="ORD-003"
Loop Over Block Output
scrape_products loop iterates over extract_products_output.product_urls and extracts details from each URL.
Nested Loops
Default Values
Provide default values for optional parameters:Jinja2 Filters
Use Jinja2 filters to transform data:Join Array
["Python", "JavaScript", "SQL"]
Output: "Python, JavaScript, SQL"
Upper/Lower Case
"john smith"
Output: "JOHN SMITH"
Length
[1, 2, 3, 4, 5]
Output: "There are 5 items to process."
Default Value
user_name is undefined or null, outputs "Welcome Guest".
Conditional Logic
Useconditional blocks to branch based on parameter values:
Best Practices
1. Use Descriptive Parameter Keys
2. Add Descriptions
3. Use JSON Schema for Complex Data
Instead of multiple flat parameters, use a single JSON parameter with a schema:4. Validate Critical Parameters
Usevalidation blocks to check parameter values:
5. Extract Complex Expressions to Code Blocks
For complex transformations, usecode blocks:
Common Patterns
Pattern 1: Parse File → Process Items
Pattern 2: Extract → Validate → Branch
Pattern 3: Multi-Source Data Aggregation
Next Steps
Workflow Blocks
Complete reference of all block types
Running Workflows
Execute workflows and retrieve results
Creating Workflows
Build workflows with SDK, API, or UI