defineComponent
function:
event
from the trigger step is still available, but exposed in steps.trigger.event
instead.$
variable has been passed into the run
function where your code is executed.$
as the entry point to built in Pipedream functions. In v1, this special functions included $end
, $respond
, etc. In v2, these have been remapped to $.flow.exit
and $.respond
respectively.
These changes unify workflow development to the Component API used by pre-built actions and also allows the defining of props from within your code steps.
import
your packages in the top of the step, just like a normal Node.js module:
this
within a Node.js step and the properties would be available as step exports:
return
to export data is the same from v1 to v2. You can still return
data, and it will be available to other steps with `steps.[stepName].$return_value.$end
function can be called to exit a flow early:
$.flow.exit
:
params
. In the v2 builder, you pass input using props.
You can still enter free text and select data from other steps in pre-built actions. Also can add your own custom props that accept input like strings, numbers and more just like in v1.
run
function, define an app prop that your Node.js step integrates with:
$.respond
to send a JSON or string response from the HTTP call that triggered the workflow.
$checkpoint
$checkpoint
functionality to save data between workflow runs is not supported in v2, and has been replaced by Data Stores.
$checkpoint
has been removed from v2 workflows, but Data Stores provides a similar API.