Workflows

A Workflow is a reusable sequence of blocks you can drop into a project in one step. nextPYP ships system workflows for the main tutorials, and you can save and edit your own.

Pre-loaded workflows cover the Single-particle, Tomography, and Classification tutorials.

Import a workflow

  1. Open Projects , create a project or open an existing one.

  2. Click Import Workflow.

  3. Filter workflows by source (System, Mine, Shared) and search by name if the list is long. Workflows are organized by type; each entry shows how many blocks it contains.

  4. Click the workflow card you want. There is no separate Import button — selecting the card starts the import.

    Import Workflow dialog with System, Mine, and Shared templates
  5. If the workflow needs parameters (raw data locations, Resources, and so on — see Compute resources), fill in the form and click Save. If it has no parameters, nextPYP skips the form and creates the blocks immediately.

  6. Open the Run tab and click Start Run for N blocks (N is the number of blocks in the workflow; you can deselect blocks first if you only want a subset).

Inspect results by opening each block in Graph, List, or Gallery view.

Import Workflow only lists standalone templates: every root block is a data-import / source block (Raw Data, From nextPYP, and so on). To attach processing onto a block you already have, use an attachable workflow instead (see below).

Attachable workflows

An attachable workflow has a single root that needs an upstream input (for example Pre-processing after an import, or Particle picking after tomograms).

  1. Click an output port on a compatible block (or use Continue with / Add Block).

    Continue with menu on an import block (Create new, then Legacy / Preview)
  2. Open the Workflows section (after Create new, before Legacy / Preview).

  3. Pick a template. Each card shows Name (N) where N is the number of blocks.

  4. If the template asks for parameters, fill the form and click Save; otherwise the blocks appear immediately, wired to the port you clicked.

Head-less attach keeps the existing graph layout: the new blocks sit downstream of the block you started from rather than replacing it.

Save and edit your own workflows

  1. In a project Graph view, select the blocks you want to capture (click titles, right-drag a selection box, or Select All), or select all.

  2. Choose Export as workflow … from the selection menu.

  3. Give the workflow a name and description, and choose how each parameter should behave for future imports (ask the user, keep a fixed value, and so on).

  4. Click Export. Your workflow appears under Mine when you next click Import Workflow (if it is standalone) and in the port Workflows list (if it is attachable).

A selection that includes an import/source root saves a standalone template. A selection that does not include an import block saves an attachable template.

You can reopen user-owned workflows later to edit metadata, per-block display names, and parameter modes, or share them with collaborators so they show up under Shared.

Manage the same templates from Your Account → My Workflows: filter by Mine / Shared with me and by type, then share, edit, download .toml, or delete.

Your Account My Workflows tab with Mine / Shared filters

Defining workflows on disk

Administrators can also ship workflows as .toml files. Here is a minimal example:

name = "Test workflow"
description = """\
    Here goes the workflow description.
    """

# comments here are useful to share info with other workflow authors looking at this file
[blocks.rawdata]
blockId = "sp-rawdata"
name = "Raw Data"

[blocks.rawdata.args]
data_path = { ask = true }
scope_pixel = 0.66
scope_voltage = 300

[blocks.preprocessing]
blockId = "sp-preprocessing"
name = "Pre-processing"
parent = "rawdata"

[blocks.preprocessing.args]
detect_rad = 75
detect_method = "all"
slurm_tasks = 7
slurm_memory = 14

Tip

Use the workflows bundled with nextPYP as starting points. Prefer exporting from the UI when you want a template that matches the blocks you already ran successfully.

Point nextPYP at directories of .toml workflows with workflowDirs in the configuration file:

workflowDirs = ["/path/to/workflows"]