Skip to main content
Execute custom JavaScript functions deployed on Cloudflare Workers. Functions can process data, integrate with external APIs, and update workflow variables.

Configuration

  • id: Unique node identifier
  • function_id: ID of deployed function to execute
  • save_response_to: Variable name to store function response (optional)

Workflow library example

Use function slugs in local workflow source. kapso push resolves the slug to the Platform API function_id.

Function context

Kapso sends this JSON body to your function. Read it with await request.json():
Your function still uses the standard runtime signature:

Function response

Functions can return JSON to update the workflow:
Functions can also emit project events:
Project events follow the same validation rules as the Events API. A Function node response can emit at most 5 project events. See Events for limits and caveats.

How it works

  1. Invokes function: Calls your deployed function with workflow context
  2. Processes response: Updates workflow variables from function response
  3. Continues workflow: Advances to next step via next edge
  4. Saves data: Optionally stores full response in specified variable

Usage patterns

Data validation API integration Conditional processing