Function
1. Overview
The Function component (function) marks the start of a reusable sub-flow, which can be called from any other point in the same flow through the Function Caller component. It's like creating a named "function" inside the automation: you define the logic once and reuse it in multiple places.
Use it when the same sequence of steps needs to run from different points in the flow (avoiding duplicating the same logic multiple times). Don't use it as the flow's main entry point (that's the job of other trigger connectors, like HTTP or events).
2. Prerequisites
No credentials or external access — it's an internal flow-engine component.
3. Authentication and Connection
Not applicable.
4. Configuration / Supported Operations
Function works only as a trigger (entry point) for a sub-flow — it doesn't run an action on its own, it just registers itself to be called.
| Field | Required | Type | Description | Example |
|---|---|---|---|---|
name | Yes | Text | Name by which this function will be known and called by the Function Caller component. Cannot be empty. | "validateCustomer" |
Error behavior: if name isn't informed or is empty, the flow fails to start, with the corresponding error. If a function with the same name is already registered, the new one simply replaces the previous one (a warning is logged, but it's not an error).
This component receives its input exactly as sent by the Function Caller that called it — the body received is the calling component's output body.
5. Practical Examples
Simple example: a function called "formatAddress" receives a raw address and returns the formatted address. It's available to be called from anywhere in the flow through the Function Caller, using this name.
Component configuration (start of the function's sub-flow):
{
"componentName": "function",
"configurations": { "name": "formatAddress" }
}
Input received by this function when it's called (from Function Caller):
{
"street": "paulista ave",
"number": "1000",
"city": "sao paulo"
}
Response produced by the function's sub-flow (after being processed by the components chained inside it):
{
"formattedAddress": "Paulista Ave, 1000 - São Paulo"
}
Advanced example: several parts of a large flow (e.g., customer registration, record update, and batch import) need to validate the same set of business rules. Instead of repeating the same validation components three times, a single "validateCustomer" function is created, and each of the three points in the flow simply calls this function through the Function Caller, guaranteeing the validation rule is always the same.
Component configuration:
{
"componentName": "function",
"configurations": { "name": "validateCustomer" }
}
Input received by this function:
{
"name": "Maria Silva",
"taxId": "123.456.789-00",
"email": "maria@example.com"
}
Response produced by the function's sub-flow:
{
"valid": true,
"issues": []
}
6. Points of Attention
- The function's name is unique within the flow's context — configuring the same name in two Function components makes the most recent one replace the previous one.
- The function only exists while the flow containing it is active; when the flow stops, it can no longer be called.
- Works only as an entry point (trigger) — it doesn't serve for sending data out of the flow.
7. Common Errors and Troubleshooting
| Error / Symptom | Likely Cause | How to Fix |
|---|---|---|
| "Function 'name' is required in configuration" | The name field wasn't filled in. | Fill in the function name in the configuration. |
| "Function 'name' cannot be empty" | The name field was filled only with blank spaces. | Provide a valid, non-empty name. |
| Function Caller can't find the function | The name used in Function Caller doesn't exactly match the name configured here, or the function hasn't started yet. | Check that the names are identical and that the flow containing the function is active. |