Recipe + prompt
Contract obligation agent
Your own cron job checks contracts regularly for deadlines, obligations, and renewals. Tasks appear in time.
- 01 Holdings
Contracts in the workspace
- 02 Extraction
Deadlines and parties
- 03 Calendar
Query due dates
- 04 Decision
Task only when needed
- 05 Notice
Inform in time
- Starting point
- Renewal windows are found too late because nobody reads the holdings regularly.
- Automated result
- A daily run of your own cron job creates only new, idempotent tasks before the deadline.
- Inputs
-
- Contract PDF
- Your own cron schedule
- Due-date window
- Outputs
-
- Due dates
- Task
- Log
Flow
- 01Trigger via your own cron job or a webhook
- 02Read GET /analytics/calendar-due-dates
- 03Run legal extract via workflow job when needed
- 04Derive tasks idempotently
- 05Send critical notices only after approval
- Authentication
- Server-side secret key (po_sk_)
po_sk_ only from the server environment. Never in the browser, prompt, or repository. Restrict rotation and access.
- MCP profile
- Endpoints
-
GET /analytics/calendar-due-datesPOST /job/add/workflowPOST /webhooks/subscribeGET /job/get/{job_id}
- Modules
-
- OCR
- Classify
- Webhook
- Workflow
- Permissions
- Calendar, workflow jobs, subscribe to webhooks. No billing-admin actions in the agent.
- Errors and approval
- Poll 202. Retry with backoff and a cap. Idempotency via document ID + deadline. Respect 429. HITL before external notification.
- Security
-
- po_sk_ environment only
- Idempotency required
- HITL before notification
- Verify webhook HMAC
Prompt for Autonomous agent
Read this first, in full:
https://api.paperoffice.ai/latest/docs/llms-full.txt Task:
Implement an autonomous agent, started by your own cron job or by an event, that checks contract deadlines. PaperOffice has no time trigger of its own. Chat is not the control surface. Constraints:
- Base URL: https://api.paperoffice.ai/latest
- Authorization: Bearer from environment PO_API_SECRET (po_sk_…). Never in the frontend.
- Recurring, idempotent, retry with backoff, logging. Only these endpoints:
- GET /analytics/calendar-due-dates
- POST /job/add/workflow (Extract legal document; file or pofid)
- GET /job/get/{job_id}
- POST /webhooks/subscribe (HMAC-SHA256, server-side only) Rules:
- Do not create the same deadline task twice.
- External notices only after human approval.
- Abort on 401/403. 402 budget. 429 backoff. Poll 202. No endless retries. Do not invent endpoints. Do not put real keys in files. - mietvertrag-berlin-2024.pdf
- notice period: 3 months to the quarter
- next deadline: 2026-09-30
Expected result
due=2026-09-30, obligation=termination_window, task_created=true, notify=pending_hitl
Build or sell this solution with PaperOffice?
Integrator and reseller can be combined. You apply in the PaperOffice app with the Plus plan or higher. A person on the partner team reviews it and decides; this can take several business days.
Start partnership