How do you abort a workflow?

This topic was automatically generated from Slack. You can find the original thread here.

Grynn : hey folks - quick question - how do yo abort a workflow? Meaning I expected some input (say email subject matching “abc”) but if it does not match I want to aboirt the current step (and all subsequent steps). Is that possible?

Steve Lachs : Call $end and it will stop the workflow. Documentation here.

Grynn : Perfect! Thanks

$end() seems to work only for v1 workflows. For v2 I used a filter component which seems to call $.flow.exit()

1 Like

That’s correct @inki :slight_smile:

Here’s the full migration guide for v1 to v2: Migrate from v1

In general though, many of the helpers have moved to $.<helper> or $.<service>.<helper> instead of $<helper> directly.