How do I add the workflow name to error emails sent from the global error workflow?

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

Rafael Klein : hi, is there a way to get the workflow name in the global error workflow? All there is in the default workflow is event.original_context.workflow_id. Would be great to somehow get the workflow name (either directly or using the id), because with a lot of workflows it’s difficult to see in the emails which workflow failed.

2 Likes

Tod Sacerdoti : Rafael - We agree and this is on our roadmap. Feel free to follow this issue for updates.

Let me know if you have any other feedback or questions!

Dylan Sather (Pipedream) : Hi , in the meantime, you can use an undocumented API (this is subject to change, so we can’t guarantee this endpoint will remain) to retrieve the workflow name. I do this in my global error workflow.

First, add a new Node.js code step to the top of your workflow called get_workflow_name, and add the code from the same step at the top of my workflow. Add the Pipedream app to that step, and connect your Pipedream API key.

Then, you’ll need to modify the filter_and_format_error_message step below to reference the workflow name in the subject of the email. Feel free to copy my code from that step, as well.

1 Like

Rafael Klein : Great thanks, will have a look!

Great, I got this working. This will help me figure out if an email notification is from a new error I need to check out or if it’s an error I already dealt with because I saw it directly from the Pipedream interface while testing.

@CelesteBancosHP FYI we just released native support for referencing the workflow name within the context of your workflow (including the global error workflow): Workflow names are now available in your workflow's context

1 Like