> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentfront.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Workflow Generator

> Generate a @Workflow class

Generates a `@Workflow` class with stub step definitions.

## Usage

```bash theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
nx g @frontmcp/nx:workflow data-pipeline --project text-processing
```

## Options

| Option      | Type     | Default | Description                                      |
| ----------- | -------- | ------- | ------------------------------------------------ |
| `name`      | `string` | —       | **Required.** The name of the workflow           |
| `project`   | `string` | —       | **Required.** The project to add the workflow to |
| `directory` | `string` | —       | Subdirectory within `src/workflows/`             |

## Generated File

```
src/workflows/data-pipeline.workflow.ts
```

```ts theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
import { Workflow } from '@frontmcp/sdk';

@Workflow({
  name: 'data-pipeline',
  description: 'TODO: describe what this workflow does',
  trigger: 'manual',
  steps: [
    {
      id: 'step1',
      jobName: 'TODO-first-job',
      input: { value: 'hello' },
    },
    {
      id: 'step2',
      jobName: 'TODO-second-job',
      dependsOn: ['step1'],
      input: (steps) => ({
        value: steps.get('step1').outputs.result,
      }),
    },
  ],
})
export default class DataPipelineWorkflow {}
```

## Example

```bash theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
# Add to a specific subdirectory
nx g @frontmcp/nx:workflow etl-pipeline --project analytics --directory pipelines
# Creates: src/workflows/pipelines/etl-pipeline.workflow.ts
```

After generating, update the app to register the workflow:

```ts theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
import DataPipelineWorkflow from './workflows/data-pipeline.workflow';

@App({
  id: 'text-processing',
  workflows: [DataPipelineWorkflow],
})
class TextProcessingApp {}
```
