This topic was automatically generated from Slack. You can find the original thread here.
Is anyone aware of a bug preventing the $end(); function from working?
I’ve based my end function on the documentation here but it does not work: Code
Example code:
export default {
name: “Check status and possibly end workflow”,
async run({ steps, $ }) {
const status = steps.trigger.event.body.status;
if (conversation_status === “abandoned”) {
$end(“Ending workflow.”);
}
return steps.trigger.event;
},
}
Gives the error:
ReferenceError
$end is not defined
DETAILS
at Object.run (file:///tmp/pdg/dist/code/b6aa7dbaba653828424a39732a2edd3f1603362e0e796905c92c00297cb73435/component.mjs:6:7)
at null.executeComponent (/var/task/launch_worker.js:242:53)
at MessagePort.messageHandler (/var/task/launch_worker.js:748:28)
just to confirm, is this for a v2 workflow? We still keep the v1 docs around (notice /v1 in the path) since many users still run v1 workflows. If you visit Introduction to Pipedream, only v2 results should appear.