You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/examples/03-auto-resume-on-failure.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
`examples/03 - Auto-resume on workflow failure.json`
4
4
5
+

6
+
5
7
This workflow demonstrates how to automatically resume a failed Nextflow workflow using the workflow ID from the failed run. This pattern is useful for recovering from transient errors without re-running successfully completed tasks.
Copy file name to clipboardExpand all lines: docs/examples/05-studio-slack-webhook.md
+126-8Lines changed: 126 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,26 @@
1
1
---
2
2
title: Studio + Slack webhook
3
+
glightbox: true
3
4
---
4
5
5
6
# Pipeline → Add Studio → Slack webhook
6
7
7
8
`examples/05 - Studio on run fail + Slack webhook.json`
8
9
9
-

10
+

11
+
12
+
!!! example "In development"
13
+
14
+
This example is still in development and needs some work:
15
+
16
+
- Pre-configure the mounting of the work directory from the failed task into the studio automatically.
17
+
- Use a _Monitor Studio_ node to wait until the studio is running before sending the Slack notification.
18
+
19
+
Contributions welcome!
20
+
21
+
This workflow demonstrates intelligent failure handling with automated debugging setup and Slack notifications. It launches a workflow, monitors its execution, and sends contextualized Slack messages with direct links - either to the successful run or to a freshly provisioned Seqera Studio for debugging failures.
22
+
23
+
## Overview
10
24
11
25
This workflow has three parts to it:
12
26
@@ -24,19 +38,123 @@ If all goes well, you'll get messages in Slack that look like this:
24
38
25
39
Clicking "Open link" will take you directly to a Studio running VS Code, with your pipeline's work directory mounted and ready to debug.
26
40
41
+
## How it Works
42
+
43
+
### 1. Workflow Launch & Monitoring
44
+
45
+
The flow starts with a manual inject node (click trigger) that launches a workflow via the **Launch workflow** node. The workflow ID is automatically passed to the **Monitor workflow** node, which polls the workflow status every 5 seconds.
46
+
47
+
The monitor node has three outputs:
48
+
49
+
-**Output 1** (Active): Fires while workflow is running (unused in this example)
50
+
-**Output 2** (Succeeded): Fires when workflow completes successfully
51
+
-**Output 3** (Failed): Fires when workflow fails, cancelled, or errors
52
+
53
+
### 2. Success Path → Direct Link
54
+
55
+
When the workflow succeeds, the message flows to the **"Set webhook payload on success"** change node, which uses JSONata to construct a Slack message:
56
+
57
+
```json
58
+
{
59
+
"msg": "Workflow "& payload.workflow.projectName & " (" & payload.workflow.runName & "): Status " & payload.workflow.status & "\n\n Click the button below to view the workflow:",
This creates a deep link directly to the workflow run page in Seqera Platform.
65
+
66
+
### 3. Failure Path → Studio Creation
67
+
68
+
When the workflow fails, a more sophisticated sequence occurs:
69
+
70
+
1.**Save workflow context:**
71
+
72
+
- The **"Save payload on fail"** change node stores the workflow output in flow context (`flow.workflow_output`) so it can be referenced later, after the Studio is created.
73
+
74
+
1.**Create debugging Studio:**
75
+
76
+
- The **Add Studio** node provisions a new Seqera Studio with:
77
+
-**Name**: Generated dynamically using JSONata: `"debug-pipeline-run-" & payload.workflow.id`
78
+
-**Container**: VS Code (`public.cr.seqera.io/platform/data-studio-vscode:1.93.1-0.8`)
-**Mount Data**: Configure this to mount the Data Link containing your workflow's work directory
82
+
83
+
1.**Build Slack message with Studio link:**
84
+
85
+
- The **"Set webhook payload"** change node retrieves the saved workflow info from flow context and combines it with the newly created Studio URL:
86
+
87
+
```json
88
+
{
89
+
"msg": "Workflow "& $flowContext("workflow_output.workflow.projectName") & " (" & $flowContext("workflow_output.workflow.runName") & "): Status " & $flowContext("workflow_output.workflow.status") & "\n\n Click the button below to open a Seqera Studios session to debug:",
90
+
"button_link": payload.studio.studioUrl
91
+
}
92
+
```
93
+
94
+
### 4. Slack Webhook Notification
95
+
96
+
Both success and failure paths converge at the **Slack webhook** HTTP request node, which POSTs the payload to your Slack webhook URL. The Slack workflow receives the `msg` and `button_link` fields and displays them as a formatted message with an actionable button.
97
+
27
98
## Setup
28
99
29
100
This workflow needs some setup:
30
101
102
+
### 1. Configure Seqera Nodes
103
+
31
104
- All Seqera nodes need a Seqera configuration to be assigned
32
-
- Data Links, Pipelines, and Compute Environments need to be added to nodes
33
-
- Slack workflow needs to be created and webook URL entered.
105
+
- Set the **Launchpad** name in the Launch workflow node (or provide pipeline URL and compute environment)
106
+
- Set the **Compute Environment ID** in the Add Studio node
107
+
- Configure **Mount Data** in the Add Studio node to mount the Data Link containing your workflow work directory
108
+
109
+
!!! example "Help wanted"
110
+
111
+
This _Configure Mount Data_ is the bit that we should be able to do a better job of including in the example 👆🏻
112
+
113
+
### 2. Create Slack Workflow
114
+
115
+
To enable automated Slack notifications, you need to create a Slack Workflow with a webhook trigger:
116
+
117
+
1. Create a new workflow in Slack and select _"From a webhook"_ as the trigger:
0 commit comments