Skip to content

Commit 8c48a6d

Browse files
new pipedream error trigger update (#12948)
1 parent 0cde341 commit 8c48a6d

File tree

7 files changed

+13
-50
lines changed

7 files changed

+13
-50
lines changed

components/gagelist/gagelist.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/konfhub/konfhub.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/owl_protocol/owl_protocol.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/remote_retrieval/remote_retrieval.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/trust/trust.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/zylvie/zylvie.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

docs-v2/pages/workflows/errors.mdx

Lines changed: 7 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -30,57 +30,20 @@ For example, if your workflow throws a `TypeError`, we'll send you an email, but
3030

3131
When you're editing and testing your workflow, any unhandled errors will **not** raise errors as emails, nor are they forwarded to [error listeners](#process-errors-with-custom-logic-instead-of-email). Error notifications are only sent when a deployed workflow encounters an error on a live event.
3232

33-
## Process errors with custom logic, instead of email
33+
## Handle errors with custom logic
3434

3535
Pipedream exposes a global stream of all errors, raised from all workflows. You can subscribe to this stream, triggering a workflow on every event. This lets you handle errors in a custom way. Instead of sending all errors to email, you can send them to Slack, Discord, AWS, or any other service, and handle them in any custom way.
3636

37-
Watch this video to learn more, or check out the step-by-step docs below.
37+
To do this:
3838

39-
<VideoPlayer src="https://www.youtube.com/embed/7qVLEys_swg" title="Sending Pipedream workflow errors to Cloudwatch"/>
40-
41-
<br />
42-
43-
1. [Create a new workflow](https://pipedream.com/@/new/build?v=2). You do not need to add a trigger, since the workflow will be triggered on errors, which we'll configure next.
44-
2. Create a subscription with the following configuration:
45-
46-
- `emitter_id`: your workspace ID, found in your [Account Settings](https://pipedream.com/settings/account).
47-
- `listener_id`: The [workflow ID](/troubleshooting/#where-do-i-find-my-workflow-s-id) from step #1
48-
- `event_name`: `$errors`
49-
50-
For example, you can make this request with your Pipedream API key using `cURL`:
51-
52-
```bash
53-
curl -X POST \
54-
'https://api.pipedream.com/v1/subscriptions?emitter_id=o_abc123&event_name=$errors&listener_id=p_abc123' \
55-
-H "Authorization: Bearer <api_key>"
56-
```
57-
58-
3. Generate an error in a live version of any workflow (errors raised while you're testing your workflow [do not send errors to the `$errors` stream](#test-mode-vs-live-mode)). You should see this error trigger the workflow in step #1. From there, you can build any logic you want to handle errors across workflows.
39+
1. Create a new workflow.
40+
2. Add a new trigger. Search for the `Pipedream` app.
41+
3. Select the custom source `Workspace $error events`.
42+
4. Generate an error in a live version of any workflow (errors raised while you're testing your workflow [do not send errors to the `$errors` stream](#test-mode-vs-live-mode)). You should see this error trigger the workflow in step #1. From there, you can build any logic you want to handle errors across workflows.
5943

6044
### Duplicate errors _do_ trigger duplicate error events on custom workflows
6145

62-
Unlike [the default system emails](#duplicate-errors-do-not-trigger-duplicate-emails), duplicate errors are sent to any workflow listening to the `$errors` stream.
63-
64-
## Handle errors for one workflow using custom logic
65-
66-
Every time a workflow throws an error, it emits an event to the `$errors` stream for that workflow. You can create [a subscription](/api/rest/#listen-for-events-from-another-source-or-workflow) that delivers these errors to a Pipedream workflow, webhook, and more.
67-
68-
Let's walk through an end-to-end example:
69-
70-
1. Pick the workflow whose errors you'd like to handle and note its [workflow ID](/troubleshooting/#where-do-i-find-my-workflow-s-id).
71-
1. [Create a new workflow](https://pipedream.com/@/new/build?v=2). You do not need to add a trigger, since the workflow will be triggered on errors, which we'll configure next. Note the ID for this workflow, as well.
72-
1. Here, you're going to add the errors from the workflow in step #1 as a trigger for the workflow you created in step #2. In other words, errors from workflow #1 will trigger workflow #2.
73-
74-
Make the following request to the Pipedream API, replacing the `emitter_id` with the ID of workflow #1, and the `listener_id` with the ID of workflow #2.
75-
76-
```bash
77-
curl 'https://api.pipedream.com/v1/subscriptions?emitter_id=p_workflow1&listener_id=p_workflow2&event_name=$errors' \
78-
-X POST \
79-
-H "Authorization: Bearer <api_key>" \
80-
-H "Content-Type: application/json"
81-
```
82-
83-
4. Generate an error in a live version of any workflow (errors raised while you're testing your workflow [do not send errors to the `$errors` stream](#test-mode-vs-live-mode)). You should see this error trigger the workflow in step #1. From there, you can build any logic you want to handle errors across workflows.
46+
Unlike [the default system emails](#duplicate-errors-do-not-trigger-duplicate-emails), duplicate errors are sent to any workflow listeners.
8447

8548
## Poll the REST API for workflow errors
8649

0 commit comments

Comments
 (0)