Functions

Functions let you drop custom code into a flow when the no-code pieces aren't enough — transform data, call an API, or implement logic specific to your business, as a step.

When to use a function

  • Reshape or clean data between two connectors
  • Call an internal or unsupported API
  • Implement custom scoring, validation, or branching logic
  • Generate values (IDs, slugs, formatted strings) on the fly

Writing a function

Add the Code step. Each function receives its inputs and returns a value that becomes available to later steps.

export const code = async (inputs) => {
  // inputs are mapped from previous steps
  const tier = inputs.amount > 10000 ? 'high' : 'standard';
  return { tier };
};
  • Inputs are mapped visually from previous steps — no need to parse raw payloads.
  • Return value flows downstream like any other step output.
  • npm packages can be imported when you need a library.

Functions run in a sandboxed environment with a time limit. Keep them focused — for long-running or heavy work, call out to a dedicated service from the function instead.

Pair functions with forms to validate input, or with the knowledge base to post-process retrieved content.