Skip to content

Commit 3001692

Browse files
committed
Add examples, tidy up help text
1 parent 1f5e433 commit 3001692

File tree

9 files changed

+446
-87
lines changed

9 files changed

+446
-87
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ Install via the Node-RED palette manager _or_ from the command line inside your
2929
npm install @seqera/node-red-seqera
3030
```
3131

32+
Once installed, example flows are available in the Node-RED import menu under `Import > Examples > @seqera/node-red-seqera`.
33+
3234
# Use cases
3335

3436
- Integration with events _coming from_ and _going to_ third-party services (AWS, Slack, and [>5000 others](https://flows.nodered.org/search?type=node))
Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
[
2+
{
3+
"id": "5ddebd1124f2b1c0",
4+
"type": "tab",
5+
"label": "Create dataset, launch + monitor",
6+
"disabled": false,
7+
"info": "# Create dataset, launch + monitor\n\nThis example demonstrates a typical workflow to create a new dataset in Seqera Platform, then use it to launch and monitor a workflow. These nodes could typically be combined with 3rd party integrations.\n\n1. Configure the Seqera Platform connection with your API token\n2. Edit the example node parameters\n3. Launch the workflow and monitor its execution",
8+
"env": []
9+
},
10+
{
11+
"id": "841b1de7f2520e91",
12+
"type": "seqera-launch-monitor",
13+
"z": "5ddebd1124f2b1c0",
14+
"name": "nf-core/fetchngs",
15+
"seqera": "",
16+
"poll": "5",
17+
"pollType": "num",
18+
"launchpadName": "nf-core-fetchngs2",
19+
"launchpadNameType": "str",
20+
"paramsKey": "{\t \"outdir\":\"s3://nf-core-awsmegatests/node-red-tests/\" & $flowContext(\"myRunName\") & \"/fetchngs/results\",\t \"nf_core_pipeline\":\"rnaseq\",\t \"input\": payload.version.url\t}",
21+
"paramsKeyType": "jsonata",
22+
"workspaceId": "",
23+
"workspaceIdType": "str",
24+
"sourceWorkspaceId": "",
25+
"sourceWorkspaceIdType": "str",
26+
"x": 230,
27+
"y": 320,
28+
"wires": [[], ["5208d2bb907ddbf3"], ["23ee14a8fa7d2bc5"]]
29+
},
30+
{
31+
"id": "af2c2073b4781f2c",
32+
"type": "inject",
33+
"z": "5ddebd1124f2b1c0",
34+
"name": "Trigger launch",
35+
"props": [
36+
{
37+
"p": "topic",
38+
"vt": "str"
39+
}
40+
],
41+
"repeat": "",
42+
"crontab": "",
43+
"once": false,
44+
"onceDelay": 0.1,
45+
"topic": "",
46+
"x": 130,
47+
"y": 240,
48+
"wires": [["f1a41db5a7ed8618"]]
49+
},
50+
{
51+
"id": "f1a41db5a7ed8618",
52+
"type": "seqera-dataset-create",
53+
"z": "5ddebd1124f2b1c0",
54+
"name": "",
55+
"seqera": "",
56+
"datasetName": "myRunName",
57+
"datasetNameType": "flow",
58+
"fileContents": "\"SRR3192657\\nSRR3192658\\nSRR3192408\\nSRR3192409\"",
59+
"fileContentsType": "json",
60+
"workspaceId": "",
61+
"workspaceIdType": "str",
62+
"description": "A test dataset containing some SRA ids for fetchngs to download",
63+
"descriptionType": "str",
64+
"fileType": "csv",
65+
"x": 300,
66+
"y": 240,
67+
"wires": [["841b1de7f2520e91"]]
68+
},
69+
{
70+
"id": "5208d2bb907ddbf3",
71+
"type": "seqera-launch-monitor",
72+
"z": "5ddebd1124f2b1c0",
73+
"name": "nf-core/rnaseq",
74+
"seqera": "",
75+
"poll": "5",
76+
"pollType": "num",
77+
"launchpadName": " nf-core-rnaseq",
78+
"launchpadNameType": "str",
79+
"paramsKey": "{\t \"input\": \"s3://nf-core-awsmegatests/node-red-tests/\" & $flowContext(\"myRunName\") & \"/fetchngs/results/samplesheet/samplesheet.csv\",\t \"outdir\": \"s3://nf-core-awsmegatests/node-red-tests/\" & $flowContext(\"myRunName\") & \"/rnaseq/results\",\t \"genome\": \"GRCh37\",\t \"skip_alignment\": true\t}",
80+
"paramsKeyType": "jsonata",
81+
"workspaceId": "",
82+
"workspaceIdType": "str",
83+
"sourceWorkspaceId": "",
84+
"sourceWorkspaceIdType": "str",
85+
"x": 440,
86+
"y": 320,
87+
"wires": [[], ["db48fac27ee50dbf"], ["13e5309682b3f6e2"]]
88+
},
89+
{
90+
"id": "77c70ff42938bde1",
91+
"type": "change",
92+
"z": "5ddebd1124f2b1c0",
93+
"name": "Set flow.myRunName",
94+
"rules": [
95+
{
96+
"t": "set",
97+
"p": "myRunName",
98+
"pt": "flow",
99+
"to": "test-2025-05-07-v2",
100+
"tot": "str"
101+
}
102+
],
103+
"action": "",
104+
"property": "",
105+
"from": "",
106+
"to": "",
107+
"reg": false,
108+
"x": 420,
109+
"y": 160,
110+
"wires": [[]]
111+
},
112+
{
113+
"id": "388cfb48567a7421",
114+
"type": "inject",
115+
"z": "5ddebd1124f2b1c0",
116+
"name": "Trigger: Set dataset name",
117+
"props": [
118+
{
119+
"p": "topic",
120+
"vt": "str"
121+
}
122+
],
123+
"repeat": "",
124+
"crontab": "",
125+
"once": false,
126+
"onceDelay": 0.1,
127+
"topic": "",
128+
"x": 170,
129+
"y": 160,
130+
"wires": [["77c70ff42938bde1"]]
131+
},
132+
{
133+
"id": "13e5309682b3f6e2",
134+
"type": "debug",
135+
"z": "5ddebd1124f2b1c0",
136+
"name": "Workflow 2 - Fail",
137+
"active": true,
138+
"tosidebar": true,
139+
"console": false,
140+
"tostatus": false,
141+
"complete": "payload",
142+
"targetType": "msg",
143+
"statusVal": "",
144+
"statusType": "auto",
145+
"x": 670,
146+
"y": 340,
147+
"wires": []
148+
},
149+
{
150+
"id": "db48fac27ee50dbf",
151+
"type": "debug",
152+
"z": "5ddebd1124f2b1c0",
153+
"name": "Workflow 2 - Success",
154+
"active": true,
155+
"tosidebar": true,
156+
"console": false,
157+
"tostatus": false,
158+
"complete": "payload",
159+
"targetType": "msg",
160+
"statusVal": "",
161+
"statusType": "auto",
162+
"x": 680,
163+
"y": 300,
164+
"wires": []
165+
},
166+
{
167+
"id": "23ee14a8fa7d2bc5",
168+
"type": "debug",
169+
"z": "5ddebd1124f2b1c0",
170+
"name": "Workflow 1 - Fail",
171+
"active": true,
172+
"tosidebar": true,
173+
"console": false,
174+
"tostatus": false,
175+
"complete": "payload",
176+
"targetType": "msg",
177+
"statusVal": "",
178+
"statusType": "auto",
179+
"x": 470,
180+
"y": 400,
181+
"wires": []
182+
}
183+
]

examples/launch_check.json

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
[
2+
{
3+
"id": "1edc5af797745943",
4+
"type": "tab",
5+
"label": "Separate launch + check",
6+
"disabled": false,
7+
"info": "# Separate launch + check Workflow\n\nThis example shows the separate 'Launch' and 'Check' nodes, which offer maximum customisability. There is a timer node to keep checking the status whilst the workflow is running.\n\n1. Configure the Seqera Platform connection with your API token\n2. Set the launchpad name and parameters\n3. Launch the workflow and monitor its execution",
8+
"env": []
9+
},
10+
{
11+
"id": "4d2c2cd9108b8d5e",
12+
"type": "seqera-workflow",
13+
"z": "1edc5af797745943",
14+
"name": "",
15+
"seqera": "",
16+
"workflowId": "workflowId",
17+
"workflowIdType": "msg",
18+
"workspaceId": "",
19+
"workspaceIdType": "str",
20+
"x": 540,
21+
"y": 180,
22+
"wires": [["9b5d569d96130e41", "5fd3ea8f47740718"], ["cacbafa4ef558814"]]
23+
},
24+
{
25+
"id": "cacbafa4ef558814",
26+
"type": "debug",
27+
"z": "1edc5af797745943",
28+
"name": "Finished",
29+
"active": true,
30+
"tosidebar": true,
31+
"console": false,
32+
"tostatus": false,
33+
"complete": "payload",
34+
"targetType": "msg",
35+
"statusVal": "",
36+
"statusType": "auto",
37+
"x": 740,
38+
"y": 220,
39+
"wires": []
40+
},
41+
{
42+
"id": "9b5d569d96130e41",
43+
"type": "delay",
44+
"z": "1edc5af797745943",
45+
"name": "Check again",
46+
"pauseType": "delay",
47+
"timeout": "5",
48+
"timeoutUnits": "seconds",
49+
"rate": "1",
50+
"nbRateUnits": "1",
51+
"rateUnits": "second",
52+
"randomFirst": "1",
53+
"randomLast": "5",
54+
"randomUnits": "seconds",
55+
"drop": false,
56+
"allowrate": false,
57+
"outputs": 1,
58+
"x": 530,
59+
"y": 100,
60+
"wires": [["4d2c2cd9108b8d5e"]]
61+
},
62+
{
63+
"id": "a54852b97bd494e3",
64+
"type": "seqera-launch",
65+
"z": "1edc5af797745943",
66+
"name": "",
67+
"seqera": "",
68+
"launchpadName": "nf-core-fetchngs2",
69+
"launchpadNameType": "str",
70+
"paramsKey": "{\"outdir\":\"./results\",\"nf_core_pipeline\":\"rnaseq\"}",
71+
"paramsKeyType": "json",
72+
"workspaceId": "",
73+
"workspaceIdType": "str",
74+
"sourceWorkspaceId": "",
75+
"sourceWorkspaceIdType": "str",
76+
"x": 330,
77+
"y": 180,
78+
"wires": [["4d2c2cd9108b8d5e"]]
79+
},
80+
{
81+
"id": "591011a6c7f52ff9",
82+
"type": "inject",
83+
"z": "1edc5af797745943",
84+
"name": "Launch trigger",
85+
"props": [],
86+
"repeat": "",
87+
"crontab": "",
88+
"once": false,
89+
"onceDelay": 0.1,
90+
"topic": "",
91+
"x": 140,
92+
"y": 180,
93+
"wires": [["a54852b97bd494e3"]]
94+
},
95+
{
96+
"id": "5fd3ea8f47740718",
97+
"type": "debug",
98+
"z": "1edc5af797745943",
99+
"name": "Running Status",
100+
"active": true,
101+
"tosidebar": true,
102+
"console": false,
103+
"tostatus": false,
104+
"complete": "payload",
105+
"targetType": "msg",
106+
"statusVal": "",
107+
"statusType": "auto",
108+
"x": 760,
109+
"y": 180,
110+
"wires": []
111+
}
112+
]

nodes/seqera-config.html

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,22 @@
1313
</div>
1414
</script>
1515

16-
<script type="text/html" data-help-name="seqera-config">
17-
<p>Global Seqera Platform configuration.</p>
18-
<p>
19-
Specify the <b>Base URL</b> of your Seqera Platform instance (defaults to the public cloud) and an optional
20-
<b>API token</b> that will be used by all Seqera nodes referencing this config.
21-
</p>
16+
<script type="text/markdown" data-help-name="seqera-config">
17+
Global Seqera Platform configuration node to store connection details.
18+
19+
### Details
20+
21+
Configure the following options:
22+
23+
- **Base URL**: The base URL for the Seqera API (defaults to `https://api.cloud.seqera.io`)
24+
- **Workspace ID**: Your Seqera workspace ID (optional)
25+
- **API Token**: Your personal access token for authenticating with Seqera Platform
26+
27+
This configuration node is used by all other Seqera nodes to authenticate with the Seqera Platform API.
28+
29+
### References
30+
31+
- [Seqera Platform API docs](https://docs.seqera.io/platform/latest/api) - information on how to get an API token
2232
</script>
2333

2434
<script type="text/javascript">

nodes/seqera-dataset-create.html

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,37 @@
3232
</div>
3333
</script>
3434

35-
<script type="text/html" data-help-name="seqera-dataset-create">
36-
<p>Creates a new dataset and uploads its contents to Seqera Platform.</p>
35+
<script type="text/markdown" data-help-name="seqera-dataset-create">
36+
Creates a new dataset and uploads its file contents to Seqera Platform.
3737

38-
<p><b>Inputs</b>:
39-
<ul>
40-
<li><code>datasetName</code>: String – Name of the dataset to create</li>
41-
<li><code>fileContents</code>: CSV/TSV (string or Buffer) to upload. Defaults to `msg.payload`.</li>
42-
<li><code>fileType</code>: File format / MIME type. Choose between <code>csv</code> (default) or <code>tsv</code>.</li>
43-
<li><code>description</code>: Optional description for the dataset</li>
44-
<li><code>workspaceId</code>: Override the workspace ID from the config node</li>
45-
</ul>
46-
</p>
38+
### Inputs
4739

48-
<h4>Outputs (one output)</h4>
49-
<p>Fired once when the upload completes successfully.</p>
40+
: datasetName (string) : Name of the dataset to create.
41+
: fileContents (string | buffer) : CSV/TSV string or buffer to upload. Defaults to `msg.payload`.
42+
: fileType (string) : File format / MIME type. Choose between 'csv' (default) or 'tsv'.
43+
: description (string) : Optional description for the dataset.
44+
: workspaceId (string) : Override the workspace ID from the config node.
45+
46+
### Outputs
47+
48+
1. Standard output
49+
: payload (object) : The dataset creation response from the API.
50+
: datasetId (string) : The ID of the created dataset.
51+
: \_seqera_request (object) : Details of the dataset creation request (for debugging).
52+
: \_seqera_upload_request (object) : Details of the file-upload request (for debugging).
53+
54+
### Details
55+
56+
This node creates a dataset in Seqera Platform and uploads its contents in one step.
57+
Dataset file contents can be provided in `msg.payload` or via a configured property.
58+
59+
The node requires specifying the file format as either CSV or TSV as this is required
60+
by Seqera Platform to validate the file contents.
61+
62+
### References
63+
64+
- [Seqera Platform API docs](https://docs.seqera.io/platform/latest/api) - information about datasets
65+
- [CSV format](https://en.wikipedia.org/wiki/Comma-separated_values) - information about CSV format
5066
</script>
5167

5268
<script type="text/javascript">

0 commit comments

Comments
 (0)