# Complex Workflow with All Stages

## User Intent

"How do I configure a workflow with all processing stages? Show me complete workflow setup."

## Operation

**SDK Method**: `createWorkflow()` with all stages\
**Use Case**: Comprehensive content processing pipeline

***

## Code Example (TypeScript)

```typescript
import { Graphlit } from 'graphlit-client';
import {
  FilePreparationServiceTypes,
  ExtractionServiceTypes,
  ObservableTypes
} from 'graphlit-client/dist/generated/graphql-types';

const graphlit = new Graphlit();

const workflow = await graphlit.createWorkflow({
  name: "Complete Processing Pipeline",
  
  // Stage 1: Preparation (text extraction, OCR, transcription)
  preparation: {
    jobs: [{
      connector: {
        type: FilePreparationServiceTypes.ModelDocument,
        chunkSize: 1000,
        chunkOverlap: 200
      }
    }]
  },
  
  // Stage 2: Extraction (entity extraction)
  extraction: {
    jobs: [{
      connector: {
        type: EntityExtractionServiceTypes.ModelText,
        extractedTypes: [
          ObservableTypes.Person,
          ObservableTypes.Organization,
          ObservableTypes.Place,
          ObservableTypes.Event
        ]
      }
    }]
  },
  
  // Stage 3: Enrichment (future feature)
  // enrichment: {
  //   jobs: [{ /* enrichment config */ }]
  // },
  
  // Specification (which model to use)
  specification: { id: 'specification-id' }
});

console.log(`Created comprehensive workflow: ${workflow.createWorkflow.id}`);
```

***

## Workflow Stages

**Preparation**: Text extraction, OCR, transcription\
**Extraction**: Entity extraction, classification\
**Enrichment**: External data augmentation (future)

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.graphlit.dev/api-guides/use-cases/workflows/workflow-complex-all-stages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
