DEV Community

SunsetKit
SunsetKit

Posted on Originally published at sunsetkit.netlify.app

Pipedream to Cloudflare Workers: what maps to what

Pipedream Workflows shuts down on March 31, 2027. If your workflows are mostly custom code, a Worker is often the shortest
path: the code you wrote keeps working, and the Pipedream runtime pieces map to a few lines of plain JavaScript. This page shows the mapping.

The mapping at a glance

Pipedream Cloudflare Workers
HTTP / webhook trigger fetch(request, env, ctx) handler, one route per workflow
steps.trigger.event (body, headers, query) await request.json(), request.headers, new URL(request.url).searchParams
$.respond({ status, headers, body }) return new Response(body, { status, headers })
Schedule (timer) trigger Cron Trigger in wrangler.toml + scheduled(event, env, ctx) handler
Code step + steps.name.$return_value An async function; its return value is a normal variable
$.flow.exit("reason") return early (from fetch, return a Response)
Data store prop (this.db.get / set) Workers KV (env.KV.get / put), or D1 for queries
Secret props, environment variables wrangler secret put NAME, read as env.NAME
Connected accounts (OAuth apps) Create your own API key or OAuth app per service, store it as a secret
npm packages in code steps Normal npm install; most HTTP-based SDKs run on Workers (Node built-ins need nodejs_compat)
Python steps Rewrite in JS, or run as Python Workers (beta), or move that step to a small Node/Python service

A typical webhook workflow, before and after

Pipedream: an HTTP trigger, a code step that looks up a customer, and a step that answers the webhook.

// step "lookup"
export default defineComponent({
async run({ steps, $ }) {
const { email } = steps.trigger.event.body;
if (!email) return $.flow.exit("no email");
const r = await fetch(`https://api.example.com/customers?email=${encodeURIComponent(email)}`, {
headers: { Authorization: `Bearer ${process.env.EXAMPLE_KEY}` },
});
return await r.json();
},
});

// step "reply"
export default defineComponent({
async run({ steps, $ }) {
await $.respond({ status: 200, body: { id: steps.lookup.$return_value.id } });
},
});
Enter fullscreen mode Exit fullscreen mode

Worker: the same logic as one handler. The step return value becomes a variable, $.flow.exit becomes an early return.

export default {
async fetch(request, env, ctx) {
if (request.method !== "POST") return new Response("Method not allowed", { status: 405 });
const { email } = await request.json();
if (!email) return new Response("no email", { status: 200 });

const r = await fetch(`https://api.example.com/customers?email=${encodeURIComponent(email)}`, {
headers: { Authorization: `Bearer ${env.EXAMPLE_KEY}` },
});
const lookup = await r.json();

return Response.json({ id: lookup.id });
},
};
Enter fullscreen mode Exit fullscreen mode

Answer early, work later: if a Pipedream workflow responded first and kept working after $.respond, use
ctx.waitUntil(promise) in the Worker so the rest finishes after the response is sent.

Schedules

# wrangler.toml
name = "nightly-sync"
main = "src/index.js"
compatibility_date = "2026-12-01"
[triggers]
crons = ["0 6 * * *"]   # Workers cron runs in UTC; Pipedream timers may have used your time zone

[[kv_namespaces]]
binding = "KV"
id = "<your namespace id>"
Enter fullscreen mode Exit fullscreen mode
export default {
async scheduled(event, env, ctx) {
const last = (await env.KV.get("last_run")) ?? "1970-01-01T00:00:00Z";
// ... your former code steps, in order ...
await env.KV.put("last_run", new Date().toISOString());
},
};
Enter fullscreen mode Exit fullscreen mode

Data stores

Pipedream data stores are key-value stores, so KV is the direct match: this.db.get(key) → await env.KV.get(key, "json"),
this.db.set(key, value) → await env.KV.put(key, JSON.stringify(value)). KV is eventually consistent; if a
workflow uses a data store as a counter or a lock, use a Durable Object or D1 instead. The export does not include data store contents,
so download them from Pipedream before April 30, 2027.

Checklist before you switch the webhook URLs

  • Export every project (one export per project; up to 500 workflows or 256 MB each).
  • List the secrets from manifest.json warnings; the export replaces them with <redacted>.
  • Re-create connected accounts as your own API keys or OAuth apps.
  • Deploy the Worker, replay a few real payloads against it, compare responses.
  • Change the webhook URL at each sender (Stripe, GitHub, forms, …), then turn the Pipedream workflow off.
  • Timers: convert time zones to UTC cron.

Want to see which of your workflows fit?

Our free report reads your export ZIP in your browser and lists triggers, packages, hosts, data stores and secrets per
workflow. If you would rather not do the move yourself, we deliver the Workers or Node repo for a fixed $149 (up to 10 workflows).


Disclosure: this guide is from SunsetKit (Top Focus LLC). We made the free analyzer linked above, and we also sell a fixed-price migration to a Workers or Node repo. Not affiliated with Pipedream, Workday or Cloudflare. Drafted with AI assistance and checked against Pipedream's export format and the Cloudflare Workers docs.

Top comments (0)