Skip to content

seqeralabs/node-red-seqera

Repository files navigation

@seqera/node-red-seqera

A set of Node-RED nodes for interacting with Seqera Platform.

Gives new Node-RED node types for your automation workflows, which are designed to work together:

@seqera/node-red-seqera nodes

Important

This is an open-source project for community benefit. It is provided as-is and is not part of Seqera's officially supported toolset.

Typical Use cases

  • Integration with events coming from and going to third-party services (AWS, Slack, and >5000 others supported by Node-RED)
  • Link triggers and actions to build automation logic using a graphical builder
  • Chain workflows, launching downstream automatically
  • (Bonus) Use with Home Assistant to make your office lights go into disco mode when a pipeline completes 🪩 🕺🏻 🎉

Tip

This package includes several example flows which you can import and repurpose. See the example docs for more information.

Installation

Within Node-RED

File > Manage Palette, then the Install tab. Search for @seqera/node-red-seqera (or just "seqera") and you should find this package. Click Install and the nodes will be available.

Via the command line

Install via the Node-RED palette manager or from the command line inside your Node-RED user directory (~/.node-red):

npm install @seqera/node-red-seqera

Docker

This repository comes with a custom Docker image containing both Node-RED and the Seqera nodes, so that you can quickly launch a complete instance of Node-RED with everything you need.

Note

This image is designed to be a reference only to get you started only. You may want to customise the docker/Dockerfile and docker/settings.js files.

The image can be found at (also with verioned tags):

ghcr.io/seqeralabs/node-red-seqera:latest

To run, you can use a Docker command such as the following:

docker run -p 1880:1880 ghcr.io/seqeralabs/node-red-seqera:latest

Please note that you will need to mount a local data folder to save progress, or save flows using Projects, in case you need to kill the container to upgrade or similar. See the Node-RED documentation for more details.

Seqera Studios

In addition to the base Docker image, the repo has an image specifically designed to run within Seqera Studios, called ghcr.io/seqeralabs/node-red-seqera-studios (note -studios suffix).

To use, create a new Studio with the Template set to Prebuilt container image and enter:

ghcr.io/seqeralabs/node-red-seqera-studios:latest

Make sure that the studio is set to Always keep the session running.

Your new Studio should launch with a complete Node-RED instance that's ready for you to customise and use with Seqera automation.

Example Flows

Once installed, example flows are available in the Node-RED import menu under Import > Examples > @seqera/node-red-seqera. See the example docs for more information.

Usage

Seqera Config Node

Create a Seqera Config node to store your API credentials and default settings.

This is used by all other Seqera Node-RED nodes, so that you only have to enter your Seqera credentials once.

  • Base URL: The base URL for the Seqera API (default: https://api.cloud.seqera.io)
  • Token: Your Seqera API token. Create a Seqera access token via Your Tokens in the user menu.
  • Workspace ID: Your Seqera workspace ID

Launch a workflow

Launch a new workflow (pipeline run) on Seqera Platform.

Inputs

  • launchpadName: Name of a Launchpad entry. If supplied the node will look up the pipeline, fetch its default launch configuration and submit the run.
  • params: Key/value pairs to merge into paramsText. By default these are read from msg.params but this property can be changed in the node.
  • body: A fully-formed request body placed on msg.body or msg.payload. If present it is sent as-is and the launchpadName lookup is skipped.
  • workspaceId: Override the workspace ID from the Config node.
  • sourceWorkspaceId: Workspace that owns the source pipeline when launching a shared workflow.
  • baseUrl: Override the Seqera API URL.

Outputs (one)

  • msg.payload – Raw API response.
  • msg.workflowId – Convenience copy of the submitted workflow ID.

Monitor a workflow

Poll the status of an existing workflow run until it reaches a terminal state.

Inputs

  • workflowId (required, default: msg.workflowId): ID of the workflow to monitor.
  • workspaceId: Override the workspace ID from the Config node.

Configuration

  • keepPolling (default true): Continue polling until the workflow is finished.
  • pollInterval (default 5 seconds): Frequency of status checks.

Outputs (three)

  1. Active – Emitted on every poll while the workflow is in submitted, pending or running.
  2. Succeeded – Emitted once when the workflow reaches a success status (completed, succeeded).
  3. Failed – Emitted once for any terminal non-success status (failed, error, cancelled, …).

Each message contains:

  • msg.payload – Full workflow object from the API.
  • msg.workflowId – Convenience copy of the workflow ID.

Create Dataset

Create a new Dataset and upload its tabular contents in one step.

Inputs

  • datasetName (required): Name of the Dataset to create.
  • fileContents (required, default msg.payload): CSV/TSV content to upload.
  • fileType (default csv): Either csv or tsv. Determines the MIME type and file extension.
  • description: Dataset description.
  • workspaceId: Override the workspace ID from the Config node.
  • baseUrl: Override the Seqera API URL.

Outputs (one)

  • msg.payload – API response from the upload request.
  • msg.datasetId – ID of the newly-created Dataset.

List Files from Data Explorer

Retrieve objects from a Seqera Data Explorer link (Data Link).

Inputs

  • dataLinkName (required): Display name of the Data Link.
  • basePath: Path within the Data Link to start from.
  • prefix: Prefix filter applied to both files and folders.
  • pattern: Regular-expression filter applied to files after the prefix filter.
  • returnType (default files): files, folders or all.
  • maxResults (default 100): Maximum number of objects to return.
  • depth (default 0): Folder recursion depth (0 = current dir only).
  • workspaceId: Override the workspace ID from the Config node.
  • baseUrl: Override the Seqera API URL.

Outputs (one)

  • msg.payload.files – Array of objects returned by the API (after filtering).
  • msg.payload.resourceType, msg.payload.resourceRef, msg.payload.provider – Metadata describing the Data Link.
  • msg.files – Convenience array containing fully-qualified object names.

Poll Data Link Files

Periodically list a Data Link and emit messages when new objects appear. The node starts polling as soon as the flow is deployed – it has no message inputs.

Properties

All of the inputs from List Files from Data Explorer node, plus:

  • pollFrequency (default 15 min): Interval between polls expressed as seconds (90), MM:SS, HH:MM:SS or DD-HH:MM:SS.

Outputs (two)

  1. All results – Emitted every poll with the full, filtered list.
  2. New results – Emitted only when one or more new objects are detected since the last poll.

Both messages include the same properties:

  • msg.payload.files, msg.payload.resourceType, msg.payload.resourceRef, msg.payload.provider.
  • msg.files – Convenience array of fully-qualified object names.
  • msg.payload.nextPoll (only on the All results output) – ISO timestamp of the next scheduled poll.

Create Studio

Create a new Studio (interactive workspace) on Seqera Platform.

Inputs

  • studioName (required): Studio display name.
  • containerUri (required): Container image URI for the Studio tool.
  • computeEnvId (required): ID of the Compute Environment to run on.
  • description: Text description for the Studio.
  • mountData: One or more Data Link names to mount inside the Studio.
  • cpu (default 2)
  • memory (default 8192)
  • gpu (default 0)
  • initialCheckpointId
  • condaEnvironment
  • lifespanHours: Maximum lifetime before auto-stop.
  • isPrivate (default false)
  • spot (default false)
  • autoStart (default true)
  • workspaceId: Override the workspace ID from the Config node.
  • baseUrl: Override the Seqera API URL.

Outputs (one)

  • msg.payload – Full API response.
  • msg.studioId – ID of the created Studio.

License

Apache-2.0 license