Functions
Functions
Create, AI-draft, deploy, edit, test, secure, monitor, and call serverless functions from workflows.
DevelopersAutomation buildersAdvancedAvailable
What this guide covers
- Functions run custom JavaScript logic in a deployed Cloudflare-based runtime and become selectable by the workflow Function node.
- Prerequisites: Code must define async function handler(request, env).
- Result: Status is Deployed, a JSON test returns the expected result, and invocation history records calls.
- Limit: Saving changes redeploys the function. AI-generated code is a draft and requires security and correctness review.
What this is and when to use it
Functions run custom JavaScript logic in a deployed Cloudflare-based runtime and become selectable by the workflow Function node.
| Use it when | Expected outcome |
|---|---|
A supported node or integration cannot perform a required transformation or server-side call. | Status is Deployed, a JSON test returns the expected result, and invocation history records calls. |
Before you begin
- Code must define async function handler(request, env).
- Only deployed functions are selectable by a Function node.
- Secrets belong in Environment Secrets, not source code or AI prompts.
Prerequisites
Code must define async function handler(request, env). Only deployed functions are selectable by a Function node. Secrets belong in Environment Secrets, not source code or AI prompts.
Complete the task
- Open Agent Project → Functions and select Create Function.
- Name the function and write code or request an AI draft.
- Review AI output before applying.
- Create and deploy.
- Open the function to edit code, add secrets, run JSON tests, and review invocation history.
- Save & redeploy after changes.
- Select it in a workflow Function node and set a 1–60 second node timeout.
Confirm it worked
- Status is Deployed, a JSON test returns the expected result, and invocation history records calls.
Common problems
| Symptom | What to check |
|---|---|
Function is not selectable | Deploy it successfully first. |
Test is disabled | The function must be deployed. |
Invocation times out | Reduce work or adjust the Function node timeout within 1–60 seconds. |
Current limitations
Saving changes redeploys the function. AI-generated code is a draft and requires security and correctness review.
Product boundary
Saving changes redeploys the function. AI-generated code is a draft and requires security and correctness review.
Where to go next
Related documentation
FunctionCall a custom JavaScript function deployed on Cloudflare Workers. Exact configuration, outputs, execution behavior, errors, limits, and examples for the Function workflow node.Account, credentials, secrets, and data safetyProtect Yanola access, API keys, connected accounts, function secrets, webhooks, and customer data.Test a workflowRun a saved workflow with test contact and trigger data while preventing message, database, and external side effects.