pipedream code formatter & linter
Pipedream code steps support javascript, typescript, and python. JS/TS uses `defineComponent` with `steps` (previous step outputs), `$` (Pipedream utilities like `$.export`, `$.respond`), and a bound `this` for props/auth. python uses the `pd` context object. trigger data is at `steps.trigger.event`; secrets via `process.env`. for HTTP calls, use `fetch` or `require('axios')`.
const data=steps.trigger.event
$.export("id",data.id)
return dataworking inside pipedream? the codefmt Chrome and Firefox extension adds a right-click Fix with codefmt in the code editor, so you format and lint in place without copy-pasting in and out of this page.
components, steps, and $
Pipedream components use defineComponent with a run method that receives steps (previous step outputs) and $ (Pipedream utilities like $.export and $.respond).
codefmt beautifies your code by wrapping it in the defineComponent structure before formatting, so you can paste just the function body and get it back formatted, ready to drop into your step.
actions and sources
Pipedream supports two component types: actions (defineComponent with run({ steps, $ })) and sources (defineSource with run(event)). codefmt handles both patterns, including typescript support for type-safe Pipedream development. codefmt declares Pipedream's globals (like $) before running oxlint, so $ never shows up as an undefined variable.
pipedream python support
Pipedream also runs python code steps. the handler signature is def handler(pd), where pd.steps holds the trigger and previous-step data, and you return a dict to pass data downstream. the requestslibrary is preinstalled. codefmt formats Pipedream python with Ruff, wrapping the body first so a top-level return doesn't trip the parser.
frequently asked questions
what is $.export() in Pipedream?
$.export('key', value) makes data available to downstream steps. it's how you pass data between Pipedream steps. codefmt recognizes $ as a valid global and won't flag it as undefined.
how do I access data from previous steps?
use steps.step_name.return_value or steps.trigger.event to access data from previous workflow steps. codefmt recognizes the steps object as a valid Pipedream global.
what is the difference between actions and sources in Pipedream?
Pipedream has two component types. actions are reusable steps in a workflow that perform a single operation. they're defined with defineComponent and their run method receives ({ steps, $ }). sources are event triggers that emit data into workflows. they're defined with defineSource and their run method receives (event) directly. codefmt supports both and wraps your code in the correct structure for each.
does codefmt support typescript in Pipedream?
yes. Pipedream supports typescript natively in components, and codefmt handles ts-specific syntax like type annotations, interfaces, and generics. select the Pipedream platform variant and paste your typescript code for proper formatting and linting with Pipedream globals recognized.
how does defineComponent work in Pipedream?
defineComponent is the wrapper used by Pipedream actions. it accepts an object with props, methods, and a run method. the run method receives ({ steps, $ }), giving you access to previous step outputs (steps) and Pipedream utilities ($.export, $.respond, $.send.http). codefmt understands this structure and formats both the component wrapper and the function body correctly.
how do Pipedream sources differ from actions in signature?
sources use defineSource and their run method receives the triggering event directly: run(event). they emit data via this.$emit(...) and persist state via this.db when a db prop is declared. unlike actions, sources do not receive steps or $. they're the first thing in the workflow. codefmt applies the correct wrapper when you switch to the source variant.
does codefmt support python in Pipedream?
yes. Pipedream python steps use def handler(pd), read trigger and previous-step data from pd.steps, and return a dict for downstream steps. the requests library is preinstalled. codefmt formats Pipedream python with Ruff and wraps the body so a top-level return parses correctly.
also format code for zapier, n8n, make, hubspot data hub, hubspot cms (hubl)
other tools: json formatter and repair tool, python formatter, snippets
primary source: Pipedream: Running Node.js in workflows