***

layout: overview
slug: nemo-curator/nemo\_curator/pipeline/workflow
title: nemo\_curator.pipeline.workflow
--------------------------------------

## Module Contents

### Classes

| Name                                                                     | Description                                                            |
| ------------------------------------------------------------------------ | ---------------------------------------------------------------------- |
| [`WorkflowBase`](#nemo_curator-pipeline-workflow-WorkflowBase)           | -                                                                      |
| [`WorkflowRunResult`](#nemo_curator-pipeline-workflow-WorkflowRunResult) | Container returned by high-level workflows to expose pipeline outputs. |

### API

<Anchor id="nemo_curator-pipeline-workflow-WorkflowBase">
  <CodeBlock showLineNumbers={false} wordWrap={true}>
    ```python
    class nemo_curator.pipeline.workflow.WorkflowBase()
    ```
  </CodeBlock>
</Anchor>

<Indent>
  <Badge>
    Abstract
  </Badge>

  <Anchor id="nemo_curator-pipeline-workflow-WorkflowBase-run">
    <CodeBlock links={{"nemo_curator.pipeline.workflow.WorkflowRunResult":"#nemo_curator-pipeline-workflow-WorkflowRunResult"}} showLineNumbers={false} wordWrap={true}>
      ```python
      nemo_curator.pipeline.workflow.WorkflowBase.run(
          args = (),
          kwargs = {}
      ) -> nemo_curator.pipeline.workflow.WorkflowRunResult
      ```
    </CodeBlock>
  </Anchor>

  <Indent>
    <Badge>
      abstract
    </Badge>
  </Indent>
</Indent>

<Anchor id="nemo_curator-pipeline-workflow-WorkflowRunResult">
  <CodeBlock links={{"nemo_curator.tasks.Task":"/nemo-curator/nemo_curator/tasks/tasks#nemo_curator-tasks-tasks-Task"}} showLineNumbers={false} wordWrap={true}>
    ```python
    class nemo_curator.pipeline.workflow.WorkflowRunResult(
        workflow_name: str,
        pipeline_tasks: dict[str, list[nemo_curator.tasks.Task]] = dict(),
        metadata: dict[str, typing.Any] = dict()
    )
    ```
  </CodeBlock>
</Anchor>

<Indent>
  <Badge>
    Dataclass
  </Badge>

  Container returned by high-level workflows to expose pipeline outputs.

  <ParamField path="metadata" type="dict[str, Any] = field(default_factory=dict)" />

  <ParamField path="pipeline_tasks" type="dict[str, list[Task]] = field(default_factory=dict)" />

  <ParamField path="workflow_name" type="str" />

  <Anchor id="nemo_curator-pipeline-workflow-WorkflowRunResult-add_metadata">
    <CodeBlock showLineNumbers={false} wordWrap={true}>
      ```python
      nemo_curator.pipeline.workflow.WorkflowRunResult.add_metadata(
          key: str,
          value: typing.Any
      ) -> None
      ```
    </CodeBlock>
  </Anchor>

  <Indent>
    Add a metadata key-value pair.
  </Indent>

  <Anchor id="nemo_curator-pipeline-workflow-WorkflowRunResult-add_pipeline_tasks">
    <CodeBlock links={{"nemo_curator.tasks.Task":"/nemo-curator/nemo_curator/tasks/tasks#nemo_curator-tasks-tasks-Task"}} showLineNumbers={false} wordWrap={true}>
      ```python
      nemo_curator.pipeline.workflow.WorkflowRunResult.add_pipeline_tasks(
          pipeline_name: str,
          tasks: list[nemo_curator.tasks.Task] | None
      ) -> None
      ```
    </CodeBlock>
  </Anchor>

  <Indent>
    Record the tasks emitted by a pipeline run (empty list if None).
  </Indent>

  <Anchor id="nemo_curator-pipeline-workflow-WorkflowRunResult-extend_metadata">
    <CodeBlock showLineNumbers={false} wordWrap={true}>
      ```python
      nemo_curator.pipeline.workflow.WorkflowRunResult.extend_metadata(
          updates: dict[str, typing.Any] | None = None
      ) -> None
      ```
    </CodeBlock>
  </Anchor>

  <Indent>
    Update metadata dictionary in-place.
  </Indent>

  <Anchor id="nemo_curator-pipeline-workflow-WorkflowRunResult-get_metadata">
    <CodeBlock showLineNumbers={false} wordWrap={true}>
      ```python
      nemo_curator.pipeline.workflow.WorkflowRunResult.get_metadata(
          key: str
      ) -> typing.Any
      ```
    </CodeBlock>
  </Anchor>

  <Indent>
    Get a metadata value.
  </Indent>
</Indent>
