Develop and run code safely
The in-app editor is the shortest path for most scripts. Use a local editor when the code benefits from its own types, tests, or a longer editing loop.
Local development workflow
Section titled “Local development workflow”The editor has full intellisense and a Run button, so most of the time you can develop a code step entirely inside QuickFlo. But for longer scripts you might prefer your local editor:
-
Open your local editor (VS Code, Cursor, whatever) and create a
.tsfile. -
Stub the platform bindings at the top so TypeScript stops complaining:
declare const $env: Record<string, string>declare const $connections: Record<string, Record<string, unknown>>declare const $steps: Record<string, Record<string, unknown>>declare const $vars: Record<string, unknown>declare const initial: Record<string, unknown> -
Write your script. Use real types where you know them (e.g.
const customer = $steps['fetch-customer'] as { id: string; email: string }). -
Run it locally when practical. Mock
$env,$connections, and other workflow values as needed. -
Paste the script into the QuickFlo editor, including its imports.
-
Click Run in the editor to execute against the workflow’s actual data. Iterate from there.
What code can access
Section titled “What code can access”Code can call external services and import packages. It cannot inspect the host system, launch another process, or read and write local files.
Use File steps for files. Store configuration in Environments and read it through $env.
Limits
Section titled “Limits”| Limit | Value |
|---|---|
| Timeout | 60 seconds by default; up to 5 minutes |
| Returned data | 25 MB |
| Console output | 1 MB |
The timeout is configurable per-step under Advanced in the editor. If your script needs more than 5 minutes, you’re probably doing too much in one step — split it into multiple steps, or use a for-each loop over chunks.
For larger datasets, write records to a data store and return a summary.
QuickFlo retries temporary failures by default. If repeating the script could create, charge, send, or delete something twice, review the step’s error settings before publishing. See Customize retries when the default is wrong.
Code steps inside for-each loops
Section titled “Code steps inside for-each loops”A code step cannot live inside a for-each loop that runs iterations in parallel (concurrency greater than 1). Saving a workflow with that combination is rejected with a clear error.
You have two options:
-
Set the for-each concurrency to 1. Iterations run one at a time.
-
Move the code step outside the loop and iterate inside the script. Your script gets the upstream array on
$steps, and you can do the loop in TypeScript:const items = $steps['fetch-leads'].items as Array<{ phone: string }>const results = items.map((item) => {// ...transform each item...return { ...item, normalised: true }})return { items: results, count: results.length }This works well when the transformation needs the whole collection at once—for example, to sort, group, or aggregate it.