# AutosTimeline BR — Cronologia de Autos e Pendências (`joaosbp/case-timeline-builder-br`) Actor

Monte a cronologia de um caso a partir de vários documentos (PDFs/URLs): eventos ordenados com data, trecho exato e página, mais pendências detectadas (documentos faltantes, prazos, itens ambíguos). 100% determinístico, sem LLM. Compõe pipeline com PrazoBR.

- **URL**: https://apify.com/joaosbp/case-timeline-builder-br.md
- **Developed by:** [João Victor](https://apify.com/joaosbp) (community)
- **Categories:** Business, Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-usage

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## AutosTimeline BR — Brazilian Case File Timeline & Pending Actions Builder

**Send a set of case documents. Get back a correlated chronology with typed dates, document IDs, source pages — and a list of pending actions with no later record of compliance.**

AutosTimeline BR reads **multiple documents of the same case file** (decisões, despachos, sentenças, certidões, petições, manifestações, atas, laudos) and builds:

- 📅 **Chronological timeline** of procedural acts, ordered by date with the **origin of each date made explicit** (filing, document, signature, act);
- 🆔 **Document identification**: type, court document ID (e.g. PJe/e-SAJ `ID 2184355511`), CNJ case number, and originating actor (juízo, Ministério Público, defesa, serventia);
- ⏳ **Pending actions**: orders and determinations (cite-se, intime-se, manifeste-se, apresente, cumpra-se) **without a later record of compliance**, with deadline, assigned party, and source;
- 👯 **Duplicate documents** (identical content or same document ID across files);
- ⚠️ **Date inconsistencies** (e.g. document dated after its own filing date).

> ⚖️ **The product organizes the case file. It does not decide the case.** It never concludes on prescrição, nulidade, autoria, materialidade, or mérito — every item links back to the exact excerpt, file, and page it came from.

### Best for

- Law firms handling **voluminous case files** who need a fast, sourced chronology;
- Legal departments, insurers, audit firms, and investigative consultancies;
- Legaltechs and developers building case-management or legal-AI systems who need a structured timeline + pending-actions JSON as input.

### Why not a generic document AI?

Generic assistants summarize one document at a time. AutosTimeline BR **correlates documents**: the certidão that fulfills a citação ordered two files earlier is what turns an "order" into a "possibly fulfilled" action. And dates are never merged into a single unexplained "event date" — the field used for sorting always declares where it came from (`sortDateOrigin`).

### Input

| Field | Type | Description |
|---|---|---|
| `urls` | string\[] | Public URLs of the case documents (PDF, HTML, plain text) |
| `documents` | object\[] | Pasted documents as `{label, text}` — for non-public files |
| `caseReference` | string | Optional case number; auto-detected (CNJ) when omitted |
| `maxPagesPerDocument` | integer | Page cap per PDF (default 100) |
| `maxEventsPerDocument` | integer | Event cap per document (default 100) |

At least one of `urls` / `documents` is required.

### Output

- **Dataset** — one row per timeline event (`recordType=EVENT`) or pending action (`recordType=PENDING_ACTION`):
  - `EVENT`: `sortDate` + `sortDateOrigin` (FILING\_DATE / DOCUMENT\_DATE / SIGNATURE\_DATE / EVENT\_DATE), `event` (normalized act, e.g. "receber a denúncia"), `eventCategory` (DECISION/ORDER/MANIFESTATION/HEARING/SERVICE/FILING), `actor`, `documentId`, `documentType`, all typed dates (`documentDate`, `signatureDate`, `filingDate`, `eventDate`, `mentionedDates`), attached deadline, `sourcePage`, `sourceExcerpt`, `confidence`, `requiresHumanReview`;
  - `PENDING_ACTION`: `action`, `assignedTo`, `status` (`PENDING` / `POSSIBLY_FULFILLED` + `fulfillmentHint`), `originDocumentId`, `originDocumentDate`, deadline, `sourcePage`, `sourceExcerpt`;
- **SUMMARY.md** — human-readable chronological report (open this first);
- **timeline.csv** / **pending\_actions.csv** — spreadsheet-ready;
- **OUTPUT** — run counters: documents, pages, events by category, pending actions, duplicates, inconsistencies, errors.

#### Example

```json
{
  "recordType": "EVENT",
  "caseReference": "0001234-56.2026.8.26.0100",
  "sortDate": "2026-05-04",
  "sortDateOrigin": "FILING_DATE",
  "event": "citar",
  "eventCategory": "ORDER",
  "actor": "juízo",
  "documentId": "2184355511",
  "documentType": "decisao",
  "signatureDate": "2026-05-04",
  "filingDate": "2026-05-04",
  "deadlineValue": 10,
  "deadlineUnit": "dias",
  "sourceExcerpt": "Cite-se o réu para responder à acusação no prazo de 10 (dez) dias.",
  "confidence": 0.85
}
```

```json
{
  "recordType": "PENDING_ACTION",
  "action": "Manifeste-se o Ministério Público no prazo de 5 (cinco) dias. [prazo: 5 dias]",
  "assignedTo": "Ministério Público",
  "status": "PENDING",
  "originDocumentId": "2184400000",
  "originDocumentDate": "2026-06-10",
  "sourceExcerpt": "Manifeste-se o Ministério Público no prazo de 5 (cinco) dias."
}
```

### How it works

1. **Document layer** (shared core with [PrazoBR](https://apify.com/) — the single-document deadline extractor): PDF page splitting (PyMuPDF), HTML/text loading, SSRF protection, per-page provenance;
2. **Deterministic extraction** per document: typed dates, document ID, CNJ case number, document type, originating actor, procedural acts with attached deadlines — no external calls, fully reproducible;
3. **Correlation layer** across documents: chronological sort with explicit date origin, duplicate detection (content hash + document ID), pending-action derivation (orders without a later compliance record), and date-inconsistency flags.

Every heuristic score is capped at **0.85** — ambiguous items are flagged `requiresHumanReview` instead of being silently guessed.

### Limitations (MVP)

- **No OCR**: scanned PDF pages are skipped and counted in `ocrPagesSkipped`;
- The `POSSIBLY_FULFILLED` status is a **transparent heuristic** (later event by the assigned party, or a later certidão for citation/intimation orders) — it always ships with `requiresHumanReview=true`;
- Court-internal workflow acts (e.g. "conclusos para decisão") may appear as pending actions; treat them as "awaiting the bench", not party obligations;
- It does **not** calculate deadline end dates, prescrição, or any legal conclusion.

### Companion product

Use **\[PrazoBR — Legal Deadlines & Obligations Extractor]** for deep single-document deadline analysis; use **AutosTimeline BR** to correlate many documents into one case timeline. Both share the same document engine and JSON contract, so they compose in one pipeline.

### FAQ

**Does it work with scanned PDFs?**
Not yet — pages without a text layer are skipped and reported. OCR is not supported in the current version.

**Does it send my documents to an LLM?**
No. The MVP is 100% deterministic: no external API calls beyond fetching the URLs you provide. Documents are processed in memory and never persisted.

**Can I trust the chronology blindly?**
No — and that is by design. Every event carries its exact excerpt, file, page, and a confidence score, and ambiguous items are flagged for human review.
--------------------------------------------------------------------------------------------------------------------------------------------------------

### 🇧🇷 Suite de Dados Públicos BR / BR Public Data Suite

Este Actor faz parte de uma suite brasileira de dados públicos e jurídicos. Combine-os em pipelines:

- **LicitacoesBR** — radar de licitações PNCP (editais e vencedores): https://apify.com/joaosbp/licitacoes-pncp-br
- **CNPJ Lookup BR** — consulta CNPJ em lote com dados da Receita Federal: https://apify.com/joaosbp/cnpj-enrichment-lookup-br
- **CnpjDeltaBR** — monitor de mudanças cadastrais de CNPJs: https://apify.com/joaosbp/cnpj-delta-monitor-br
- **ComplianceBR** — screening de sanções CEIS/CNEP/CEPIM: https://apify.com/joaosbp/cnpj-sanctions-screening-br
- **Contact Scraper BR** — emails, WhatsApp + enriquecimento CNPJ: https://apify.com/joaosbp/website-contact-finder-br
- **PrazoBR** — extrator de prazos e obrigações jurídicas: https://apify.com/joaosbp/legal-deadlines-extractor-br
- **AutosTimeline BR** — cronologia de autos e pendências: https://apify.com/joaosbp/case-timeline-builder-br
- **PublicaBR** — monitor de publicações processuais (DataJud/CNJ): https://apify.com/joaosbp/publicacoes-processuais-br
- **EditalBR** — extrator de editais de concurso em PDF: https://apify.com/joaosbp/edital-extractor-br
- **Pricing Monitor BR** — monitor de páginas de preço SaaS: https://apify.com/joaosbp/competitor-pricing-page-monitor

**Pipeline sugerido:** LicitacoesBR encontra editais → CNPJ Lookup enriquece o vencedor → ComplianceBR verifica sanções → CnpjDeltaBR monitora mudanças cadastrais.

# Actor input Schema

## `caseReference` (type: `string`):

Case number or identifier informed by the user (e.g. CNJ 0000000-00.0000.0.00.0000). When omitted, the Actor uses the case number found most often in the documents.

## `urls` (type: `array`):

Public URLs of the case documents (PDF, HTML, or plain text): decisões, despachos, certidões, petições, atas, manifestações. All documents are correlated into a single timeline.

## `documents` (type: `array`):

Paste document contents directly as an array of {label, text} objects. Use this for files that are not publicly accessible via URL.

## `maxPagesPerDocument` (type: `integer`):

Safety limit of pages analyzed per document (PDFs). Extra pages are skipped and reported.

## `maxEventsPerDocument` (type: `integer`):

Maximum number of timeline events returned per document.

## Actor input object example

```json
{
  "documents": [
    {
      "label": "decisao-recebimento.pdf",
      "text": "PODER JUDICIÁRIO\nComarca de São Paulo\nProcesso nº 0001234-56.2026.8.26.0100\n\nDECISÃO\n\nID 2184355511\n\nVistos.\nRecebo a denúncia oferecida pelo Ministério Público em desfavor do réu.\nCite-se o réu para responder à acusação no prazo de 10 (dez) dias.\nIntime-se o Ministério Público.\n\nSão Paulo, 4 de maio de 2026.\nJuiz de Direito\n\nJuntada em 04/05/2026."
    },
    {
      "label": "certidao-citacao.pdf",
      "text": "CERTIDÃO\n\nProcesso nº 0001234-56.2026.8.26.0100\n\nCertifico que foi citado o réu nos autos do processo em referência, conforme mandado cumprido pelo oficial de justiça.\n\nSão Paulo, 20 de maio de 2026.\nEscrivão\n\nJuntada em 20/05/2026."
    },
    {
      "label": "despacho-manifestacao.pdf",
      "text": "DESPACHO\n\nProcesso nº 0001234-56.2026.8.26.0100\n\nID 2184400000\n\nApresentada a resposta à acusação pela defesa.\nManifeste-se o Ministério Público no prazo de 5 (cinco) dias.\n\nSão Paulo, 10 de junho de 2026.\nJuiz de Direito\n\nJuntada em 10/06/2026."
    }
  ],
  "maxPagesPerDocument": 100,
  "maxEventsPerDocument": 100
}
```

# Actor output Schema

## `timelineCsv` (type: `string`):

UTF-8 CSV with one row per chronological event: sort date + origin, act, category, actor, document ID/type, all typed dates, page, excerpt, confidence, review flag.

## `pendingActionsCsv` (type: `string`):

UTF-8 CSV with one row per pending action: status, action, assigned party, origin document ID/date, deadline, fulfillment hint, confidence.

## `datasetItems` (type: `string`):

Full structured rows (EVENT and PENDING\_ACTION) with all fields, including typed dates, source excerpts, and confidence scores.

## `summary` (type: `string`):

Counts of documents processed, pages analyzed, events by category, pending actions, duplicate document groups, date inconsistencies, review-required items, and errors.

## `executiveSummary` (type: `string`):

Human-readable SUMMARY.md with the ordered timeline, pending actions table, duplicates, and date inconsistencies. Open this first.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "documents": [
        {
            "label": "decisao-recebimento.pdf",
            "text": "PODER JUDICIÁRIO\nComarca de São Paulo\nProcesso nº 0001234-56.2026.8.26.0100\n\nDECISÃO\n\nID 2184355511\n\nVistos.\nRecebo a denúncia oferecida pelo Ministério Público em desfavor do réu.\nCite-se o réu para responder à acusação no prazo de 10 (dez) dias.\nIntime-se o Ministério Público.\n\nSão Paulo, 4 de maio de 2026.\nJuiz de Direito\n\nJuntada em 04/05/2026."
        },
        {
            "label": "certidao-citacao.pdf",
            "text": "CERTIDÃO\n\nProcesso nº 0001234-56.2026.8.26.0100\n\nCertifico que foi citado o réu nos autos do processo em referência, conforme mandado cumprido pelo oficial de justiça.\n\nSão Paulo, 20 de maio de 2026.\nEscrivão\n\nJuntada em 20/05/2026."
        },
        {
            "label": "despacho-manifestacao.pdf",
            "text": "DESPACHO\n\nProcesso nº 0001234-56.2026.8.26.0100\n\nID 2184400000\n\nApresentada a resposta à acusação pela defesa.\nManifeste-se o Ministério Público no prazo de 5 (cinco) dias.\n\nSão Paulo, 10 de junho de 2026.\nJuiz de Direito\n\nJuntada em 10/06/2026."
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("joaosbp/case-timeline-builder-br").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "documents": [
        {
            "label": "decisao-recebimento.pdf",
            "text": """PODER JUDICIÁRIO
Comarca de São Paulo
Processo nº 0001234-56.2026.8.26.0100

DECISÃO

ID 2184355511

Vistos.
Recebo a denúncia oferecida pelo Ministério Público em desfavor do réu.
Cite-se o réu para responder à acusação no prazo de 10 (dez) dias.
Intime-se o Ministério Público.

São Paulo, 4 de maio de 2026.
Juiz de Direito

Juntada em 04/05/2026.""",
        },
        {
            "label": "certidao-citacao.pdf",
            "text": """CERTIDÃO

Processo nº 0001234-56.2026.8.26.0100

Certifico que foi citado o réu nos autos do processo em referência, conforme mandado cumprido pelo oficial de justiça.

São Paulo, 20 de maio de 2026.
Escrivão

Juntada em 20/05/2026.""",
        },
        {
            "label": "despacho-manifestacao.pdf",
            "text": """DESPACHO

Processo nº 0001234-56.2026.8.26.0100

ID 2184400000

Apresentada a resposta à acusação pela defesa.
Manifeste-se o Ministério Público no prazo de 5 (cinco) dias.

São Paulo, 10 de junho de 2026.
Juiz de Direito

Juntada em 10/06/2026.""",
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("joaosbp/case-timeline-builder-br").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "documents": [
    {
      "label": "decisao-recebimento.pdf",
      "text": "PODER JUDICIÁRIO\\nComarca de São Paulo\\nProcesso nº 0001234-56.2026.8.26.0100\\n\\nDECISÃO\\n\\nID 2184355511\\n\\nVistos.\\nRecebo a denúncia oferecida pelo Ministério Público em desfavor do réu.\\nCite-se o réu para responder à acusação no prazo de 10 (dez) dias.\\nIntime-se o Ministério Público.\\n\\nSão Paulo, 4 de maio de 2026.\\nJuiz de Direito\\n\\nJuntada em 04/05/2026."
    },
    {
      "label": "certidao-citacao.pdf",
      "text": "CERTIDÃO\\n\\nProcesso nº 0001234-56.2026.8.26.0100\\n\\nCertifico que foi citado o réu nos autos do processo em referência, conforme mandado cumprido pelo oficial de justiça.\\n\\nSão Paulo, 20 de maio de 2026.\\nEscrivão\\n\\nJuntada em 20/05/2026."
    },
    {
      "label": "despacho-manifestacao.pdf",
      "text": "DESPACHO\\n\\nProcesso nº 0001234-56.2026.8.26.0100\\n\\nID 2184400000\\n\\nApresentada a resposta à acusação pela defesa.\\nManifeste-se o Ministério Público no prazo de 5 (cinco) dias.\\n\\nSão Paulo, 10 de junho de 2026.\\nJuiz de Direito\\n\\nJuntada em 10/06/2026."
    }
  ]
}' |
apify call joaosbp/case-timeline-builder-br --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=joaosbp/case-timeline-builder-br",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/nNfQFJEdF4sgjoJfe/builds/VFzxbdNeYqjRI4tqD/openapi.json
