Skip to main content
Generates a @Workflow class with stub step definitions.

Usage

nx g @frontmcp/nx:workflow data-pipeline --project text-processing

Options

OptionTypeDefaultDescription
namestringRequired. The name of the workflow
projectstringRequired. The project to add the workflow to
directorystringSubdirectory within src/workflows/

Generated File

src/workflows/data-pipeline.workflow.ts
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

# 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:
import DataPipelineWorkflow from './workflows/data-pipeline.workflow';

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