Skip to main content
Early access. This feature is in early access, which means it’s undergoing ongoing testing and development while we gather feedback, validate functionality, and improve outputs. Contact the C1 Support team if you’d like to try it out or share feedback.
Functions work as steps in automation workflows, allowing you to add custom logic between other automation actions. When configured as a function step, the automation engine:
  1. Evaluates argument expressions (CEL) against the automation context
  2. Passes the evaluated arguments as your function’s input
  3. Captures your return value for use by subsequent steps
When writing functions for use in automations, remember:
  • Your function doesn’t need to know it’s called from an automation. It receives JSON in, returns JSON out.
  • The automation UI defines which CEL expressions map to which input keys.
  • Your return value becomes available to subsequent automation steps via the step name (such as checkTraining.approved).
  • The function runs with the same security model regardless of trigger source: pre-authenticated SDK, egress allowlist, no filesystem.

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:
Pass output from a previous step: 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 named checkTraining, 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

  1. Trigger: Access request created
  2. Step 1: Run Function checkTraining
    • Input: { "userId": "trigger.user_id" }
  3. 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

Best practices

Design your function outputs to work well with automation conditionals and debugging.

Return structured data

Make your function outputs easy to use in conditionals:

Use Boolean flags for conditionals

Return clear true/false values that work well in automation conditions:

Include context for debugging

Return enough information to troubleshoot issues: