> ## 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

**1. Open New Extraction**

Go to the Platform and open **New Extraction** from the sidebar.

**2. Upload a representative invoice**

Use a real sample format if you can. Representative documents matter more than perfect toy examples.

**3. Run Extract first**

Keep the first run simple. Run Extract and inspect the Markdown and Tables tabs so you know what Pulse saw.

**4. Add Schema**

Add a Schema step. Start with the fields you need in production: invoice number, vendor, dates, total, and line items.

**5. 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.

**6. 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.

**7. Show Code**

Open Show Code and choose Python, TypeScript, or cURL. The generated code will match your tested configuration.

## Visual Walkthrough

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

![Pulse Platform upload screen with Extract settings open](https://mintcdn.com/pulseai/OJ897TEZf8bV6lk8/images/platform/main-dashboard-content.png?fit=max\&auto=format\&n=OJ897TEZf8bV6lk8\&q=85\&s=f20bd253422dc9cd5f500ccb8c662119)

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

![Pipeline step menu with Split, Tables, and Schema options](https://mintcdn.com/pulseai/OJ897TEZf8bV6lk8/images/platform/choose-step-in-pipeline.png?fit=max\&auto=format\&n=OJ897TEZf8bV6lk8\&q=85\&s=ef1521834ea8d02b6aa4ca73238982ef)

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

![Pulse pipeline configuration screen with Extract, Split, and Schema steps](https://mintcdn.com/pulseai/OJ897TEZf8bV6lk8/images/platform/configure-steps-content.png?fit=max\&auto=format\&n=OJ897TEZf8bV6lk8\&q=85\&s=16570f2afb038733fecff66115d3c0a3)

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

![Pulse Playground showing extracted markdown and table output beside a source PDF](https://mintcdn.com/pulseai/OJ897TEZf8bV6lk8/images/platform/post-extraction-content.png?fit=max\&auto=format\&n=OJ897TEZf8bV6lk8\&q=85\&s=0b8793c358ed3f32d21d23a48d3ffc37)

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

![Show Code modal with generated Python for a Pulse extraction pipeline](https://mintcdn.com/pulseai/OJ897TEZf8bV6lk8/images/platform/show-code.png?fit=max\&auto=format\&n=OJ897TEZf8bV6lk8\&q=85\&s=f27dd143a89211c02df14edaf035d1e7)

## 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

> [card] [Bank Statement To JSON](https://docs.runpulse.com/cookbooks/invoice-to-json.md)
>
> A complete Extract -> Schema API recipe with a public sample document.

> [card] [Platform To Production](https://docs.runpulse.com/platform-reference/platform-to-production.md)
>
> Use presets and Show Code well.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.