Run JavaScript and TypeScript steps in your workflow engine. Sub-10ms cold starts, pay-per-millisecond pricing, and secure isolation for user code.
Whether you're building Zapier-style automation or AI-powered workflows, Serverless Runs provide the execution layer you need.
Execute workflow steps instantly. No waiting for containers to spin up or functions to warm.
Billed only for execution time. An 84ms step costs 84ms. No minimum charges.
Allow or deny specific domains. Route traffic through your proxy for auditing.
Each run executes in its own V8 isolate. Complete isolation between executions.
Store workflow definitions in Freestyle Git. Branch, fork, and version your automation.
Write steps in TypeScript with any npm package. No transpilation required.
See how Serverless Runs fit into different workflow architectures.
Transform data between steps. Parse JSON, validate schemas, map fields.
const { result } = await freestyle.serverless.runs.create({
code: `
import { z } from 'zod';
export default (input) => {
const schema = z.object({
amount: z.number(),
currency: z.string()
});
const validated = schema.parse(input);
return {
cents: validated.amount * 100,
currency: validated.currency.toUpperCase()
};
};
`,
nodeModules: { zod: "3.22.4" },
input: workflowData
});Call external APIs as workflow steps. Handle auth, retries, and errors.
const { result } = await freestyle.serverless.runs.create({
code: `
export default async (input) => {
const response = await fetch('https://api.stripe.com/v1/charges', {
method: 'POST',
headers: {
'Authorization': \`Bearer \${process.env.STRIPE_KEY}\`,
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({
amount: input.amount,
currency: input.currency
})
});
return response.json();
};
`,
envVars: { STRIPE_KEY: stripeKey },
input: { amount: 1000, currency: 'usd' }
});Let users write custom steps. Execute their code safely in isolated environments.
// User-provided code
const userCode = user.customTransform;
const { result } = await freestyle.serverless.runs.create({
code: userCode,
config: {
// Restrict what the code can access
networkPermissions: [
{ action: "allow", domain: "api.approved.com", behavior: "exact" }
],
timeout: 5000
},
input: workflowData
});Store workflow definitions in Freestyle Git for full version control. Branch to experiment, revert mistakes, and track changes over time.
import { freestyle } from "freestyle";
// Store workflow in Git
const { repo, repoId } = await freestyle.git.repos.create();
await repo.contents.write({
path: "transform.ts",
content: btoa(transformCode),
message: "Add transform step"
});
// Run workflow from Git
const file = await repo.contents.get({
path: "transform.ts",
rev: "main"
});
const { result } = await freestyle.serverless.runs.create({
code: atob(file.content),
input: workflowData
});
// Trigger on changes
await repo.triggers.create({
trigger: { event: "push", branches: ["main"] },
action: {
action: "webhook",
endpoint: "https://your-api.com/workflow-updated"
}
});Fast, cheap, and secure code execution for any workflow engine.

