Solution

Execute custom code in your workflows

Run JavaScript and TypeScript steps in your workflow engine. Sub-10ms cold starts, pay-per-millisecond pricing, and secure isolation for user code.

No Limits
Execute any custom code
Pay Per Use
$0.00001 per ms
Fast Execution
V8 isolate sandboxing

Built for workflow engines

Whether you're building Zapier-style automation or AI-powered workflows, Serverless Runs provide the execution layer you need.

Sub-10ms Cold Starts

Execute workflow steps instantly. No waiting for containers to spin up or functions to warm.

Pay Per Millisecond

Billed only for execution time. An 84ms step costs 84ms. No minimum charges.

Network Controls

Allow or deny specific domains. Route traffic through your proxy for auditing.

Secure Isolation

Each run executes in its own V8 isolate. Complete isolation between executions.

Version Workflows in Git

Store workflow definitions in Freestyle Git. Branch, fork, and version your automation.

Full TypeScript Support

Write steps in TypeScript with any npm package. No transpilation required.

Common workflow patterns

See how Serverless Runs fit into different workflow architectures.

Data Transformations

Transform data between steps. Parse JSON, validate schemas, map fields.

example.ts
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
});

API Orchestration

Call external APIs as workflow steps. Handle auth, retries, and errors.

example.ts
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' }
});

Custom User Logic

Let users write custom steps. Execute their code safely in isolated environments.

example.ts
// 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
});

Version workflows in Git

Store workflow definitions in Freestyle Git for full version control. Branch to experiment, revert mistakes, and track changes over time.

  • Store workflow code in Git repos
  • Trigger runs on push events
  • Branch workflows for testing
  • Full commit history for auditing
versioned-workflow.ts
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"
  }
});

Power your workflows with Freestyle

Fast, cheap, and secure code execution for any workflow engine.



Floodgate logoY Combinator logoHustle Fund logoTwo Sigma Ventures logo
© 2026 Freestyle