- Evaluates argument expressions (CEL) against the automation context
- Passes the evaluated arguments as your function’s
input - Captures your return value for use by subsequent steps
Step 1: Add a function step to an automation
Before you begin, make sure you’ve created and published a function and set up an automation. Once your function is published, you can add it as a step in any automation workflow:1
Navigate to Workflows > Automations and open your automation in the editor.
2
Click Add Step.
3
Select Call function.
4
Choose your published function from the dropdown.
5
Click Add argument to define the input your function receives. Read more about arguments in the next section.
Step 2: Pass argument input to your function
In the automation UI, each argument is a CEL expression evaluated against the workflow context. These expressions are evaluated, marshaled to JSON, and passed as your function’s input.Available context
Example inputs
The examples below show how you configure arguments in the automation UI. The left side is the key name your function receives; the right side is a CEL expression that gets evaluated at runtime. Pass data from a trigger:
Your function receives the evaluated values:
Static values:
For literal values, wrap strings in quotes within the CEL expression:
Step 3: Access function output in later steps
The output of your function is available in subsequent steps via the step context. If your function step is namedcheckTraining, access its output like this:
Example: Training verification workflow
This example shows a complete workflow that checks a user’s training status before approving access.Function code
Automation workflow
- Trigger: Access request created
- Step 1: Run Function
checkTraining- Input:
{ "userId": "trigger.user_id" }
- Input:
- Step 2: Conditional - Check if training is completed
- Condition:
steps.checkTraining.output.eligible == true - If true: Approve the access request
- If false: Send notification to user with training link
- Condition: