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

# Build Your First Pipeline

> Create, test, save, and export a complete Pulse pipeline from the Platform.

This walkthrough builds a simple invoice extraction workflow in the Platform, then turns it into production-ready code.

## Target Workflow

```mermaid theme={null}
flowchart LR
    A[Invoice PDF] --> B[Extract]
    B --> C[Schema]
    C --> D[Invoice JSON]
    D --> E[Show Code]
```

## Steps

<Steps>
  <Step title="Open New Extraction">
    Go to the Platform and open **New Extraction** from the sidebar.
  </Step>

  <Step title="Upload a representative invoice">
    Use a real sample format if you can. Representative documents matter more than perfect toy examples.
  </Step>

  <Step title="Run Extract first">
    Keep the first run simple. Run Extract and inspect the Markdown and Tables tabs so you know what Pulse saw.
  </Step>

  <Step title="Add Schema">
    Add a Schema step. Start with the fields you need in production: invoice number, vendor, dates, total, and line items.
  </Step>

  <Step title="Review citations">
    Confirm the output values point to the right source locations. If a field is ambiguous, improve its description or add a schema prompt.
  </Step>

  <Step title="Save the schema preset">
    Save the schema once it works on more than one invoice. This gives you a `schema_config_id` for production code.
  </Step>

  <Step title="Show Code">
    Open Show Code and choose Python, TypeScript, or cURL. The generated code will match your tested configuration.
  </Step>
</Steps>

## Visual Walkthrough

Start with a single Extract step and keep the first run simple.

<img src="https://mintcdn.com/pulseai/OJ897TEZf8bV6lk8/images/platform/main-dashboard-content.png?fit=max&auto=format&n=OJ897TEZf8bV6lk8&q=85&s=f20bd253422dc9cd5f500ccb8c662119" alt="Pulse Platform upload screen with Extract settings open" width="1468" height="916" data-path="images/platform/main-dashboard-content.png" />

Add the next step from the pipeline menu once the extraction output looks usable.

<img src="https://mintcdn.com/pulseai/OJ897TEZf8bV6lk8/images/platform/choose-step-in-pipeline.png?fit=max&auto=format&n=OJ897TEZf8bV6lk8&q=85&s=ef1521834ea8d02b6aa4ca73238982ef" alt="Pipeline step menu with Split, Tables, and Schema options" width="452" height="234" data-path="images/platform/choose-step-in-pipeline.png" />

Configure each step in the right-side panel. For this tutorial, add Schema after Extract.

<img src="https://mintcdn.com/pulseai/OJ897TEZf8bV6lk8/images/platform/configure-steps-content.png?fit=max&auto=format&n=OJ897TEZf8bV6lk8&q=85&s=16570f2afb038733fecff66115d3c0a3" alt="Pulse pipeline configuration screen with Extract, Split, and Schema steps" width="1464" height="913" data-path="images/platform/configure-steps-content.png" />

Review the source document and output side by side before you save presets or export code.

<img src="https://mintcdn.com/pulseai/OJ897TEZf8bV6lk8/images/platform/post-extraction-content.png?fit=max&auto=format&n=OJ897TEZf8bV6lk8&q=85&s=0b8793c358ed3f32d21d23a48d3ffc37" alt="Pulse Playground showing extracted markdown and table output beside a source PDF" width="1467" height="914" data-path="images/platform/post-extraction-content.png" />

Use Show Code when the tested pipeline is ready to move into your app.

<img src="https://mintcdn.com/pulseai/OJ897TEZf8bV6lk8/images/platform/show-code.png?fit=max&auto=format&n=OJ897TEZf8bV6lk8&q=85&s=f27dd143a89211c02df14edaf035d1e7" alt="Show Code modal with generated Python for a Pulse extraction pipeline" width="719" height="476" data-path="images/platform/show-code.png" />

## Starter Schema

```json theme={null}
{
  "type": "object",
  "properties": {
    "invoice_number": {
      "type": "string",
      "description": "The invoice identifier shown by the vendor"
    },
    "vendor_name": {
      "type": "string",
      "description": "The vendor issuing the invoice"
    },
    "invoice_date": {
      "type": "string",
      "description": "The date the invoice was issued"
    },
    "due_date": {
      "type": "string",
      "description": "The payment due date"
    },
    "total_amount": {
      "type": "number",
      "description": "The final amount due"
    }
  },
  "required": ["invoice_number", "vendor_name", "total_amount"]
}
```

## Improve The Pipeline

Once the basic flow works, make it more production-ready:

| Need                            | Add                                           |
| ------------------------------- | --------------------------------------------- |
| Only certain pages matter       | Page range on Extract                         |
| Line item tables need structure | Tables step                                   |
| Many invoice formats            | Better field descriptions and a schema prompt |
| Repeatable production config    | Saved Extract and Schema presets              |
| High volume                     | Batch or async processing                     |
| Long jobs                       | Webhooks or polling                           |

## Move To Code

Generated code should become the starting point for your app integration. In production, replace sample paths and keys with your own inputs and secret management.

```python theme={null}
import os
from pulse import Pulse

client = Pulse(api_key=os.environ["PULSE_API_KEY"])

result = client.extract(
    file=open("invoice.pdf", "rb"),
)

schema_result = client.schema(
    extraction_id=result.extraction_id,
    schema_config_id="YOUR_SAVED_SCHEMA_CONFIG_ID",
)

print(schema_result.schema_output["values"])
```

## Related

<CardGroup cols={2}>
  <Card title="Bank Statement To JSON" icon="building-columns" href="/cookbooks/invoice-to-json">
    A complete Extract -> Schema API recipe with a public sample document.
  </Card>

  <Card title="Platform To Production" icon="rocket" href="/platform-reference/platform-to-production">
    Use presets and Show Code well.
  </Card>
</CardGroup>
