Skip to main content
The Execute Code action runs a JavaScript or TypeScript module in a temporary Bun container. Use it when a workflow needs a transformation that available actions cannot express.
Custom code can make network requests, import packages, consume resources, and expose any values connected as inputs. Review the code and every input before running it, especially credentials or personal data.

Inputs

Outputs

You can expose properties from Outputs as individual node outputs, then connect only the values later actions need.

Read inputs and return outputs

Import the default export from ./inputs, then export each result as a named value:
Configure Input Variables with subtotal and taxRate. The action returns:
The message written with console.log appears in Logs, not Outputs.
Use identifier-like input names such as customerId or lineItems. They are easier to access as inputs.customerId and produce useful TypeScript editor hints.

Import packages

Code runs with the Bun runtime, so standard imports are supported:
Bun can resolve npm package imports during execution. Version specifiers may be used when the exact package version matters.

Serialization rules

Inputs and outputs cross the action boundary as JSON:
  • Inputs may contain strings, numbers, booleans, null, lists, and objects.
  • Exported functions, symbols, undefined, and other non-JSON values are not reliable outputs.
  • BigInt, circular objects, and other values that JSON cannot serialize cause the run to fail.
  • Class instances lose behavior when serialized; return plain data instead.
The code is executed as a module. Only exported values are returned. Local variables stay private unless you add a named export.

Troubleshooting

Confirm that its Input Variables name matches the property read from the default ./inputs export. Names are case-sensitive.
Add named exports such as export const result = value. Logging a value does not return it.
Check every exported value for JSON compatibility. Remove functions, BigInt, circular references, and unsupported runtime objects.
Check the package name and import path. If reproducibility matters, specify a supported npm version in the import rather than relying on the latest resolved package.