Prompt
How do I automate procurement requests with a workflow API?
Latest observation
Oct 24, 2026
OpenAI APIWeb search: off
To automate procurement requests with a workflow API, you generally want to turn a manual intake-and-approval process into a set of API-driven steps:
- Submit a request
- Validate and enrich it
- Route for approvals
- Create procurement tasks / purchase orders
- Track status and notify stakeholders
- Store audit history
Typical workflow design
1) Define the request payload
Create a standard JSON schema for procurement requests, for example:
{
"requesterId": "u123",
"department": "IT",
"items": [
{
"sku": "laptop-15",
"description": "Business laptop",
"quantity": 10,
"estimatedUnitPrice": 1200
}
],
"justification": "New hires in Q3",
"neededBy": "2026-02-15",
"costCenter": "CC-1002"
}
2) Create a workflow endpoint
Your API should expose an endpoint like:
POST /procurement/requests— create a requestGET /procurement/requests/{id}— check statusPOST /procurement/requests/{id}/approve— approvePOST /procurement/requests/{id}/reject— rejectPOST /procurement/requests/{id}/escalate— escalate
3) Start a workflow instance
When a request is submitted:
- save the request in your database
- start a workflow instance in your workflow engine
- set the initial state to something like
pending_validation
Example workflow stages:
submittedvalidatedmanager_approvalfinance_approvalprocurement_revieworderedfulfilledclosed
4) Add business rules
Use API logic or workflow rules to route requests:
- If total amount < $5,000, only manager approval required
- If $5,000–$25,000, manager + finance approval
- If above $25,000, add procurement director approval
- If category is “software,” require IT/security review
5) Integrate with external systems
Your workflow API can trigger downstream actions:
- ERP / purchasing system to create a purchase order
- vendor system to request quotes
- email/Slack/Teams notifications
- document storage for attachments and approvals
6) Track and audit
Each workflow action should be logged:
- who approved
- timestamp
- decision
- comments
- version of the request
This is important for compliance and audits.
Example API flow
Create a request
POST /procurement/requests
Content-Type: application/json
Authorization: Bearer <token>
Response:
{
"requestId": "pr-789",
"status": "submitted",
"workflowInstanceId": "wf-456"
}
Workflow engine evaluates and routes
It may auto-route to approvers:
{
"currentStep": "manager_approval",
"assignedTo": "manager_22",
"dueDate": "2026-01-30"
}
Approver acts
POST /procurement/requests/pr-789/approve
Content-Type: application/json
{
"approvedBy": "manager_22",
"comment": "Approved for Q3 hiring"
}
Workflow moves to finance or procurement depending on rules.
Recommended implementation pattern
Option A: Use a workflow engine
Good for complex approval chains and long-running processes.
Examples:
- Camunda
- Temporal
- Zeebe
- AWS Step Functions
- Azure Durable Functions
Option B: Build a lightweight rules-based API
Good for simpler workflows.
- store request state in DB
- use a state machine
- trigger async jobs / webhooks
Best practices
- Idempotency: prevent duplicate request creation
- Role-based access control: only authorized approvers can act
- Webhook retries: handle transient failures when calling external systems
- Attachment support: invoices, quotes, specs, contracts
- SLA timers: escalate if approval is overdue
- Validation: check budget, vendor, policy, and required fields before routing
Minimal architecture
- Frontend / portal → submits requests
- Workflow API → handles request lifecycle
- Approval service → assigns reviewers
- Integration service → creates POs / talks to ERP
- Notification service → emails/messages
- Audit store → immutable history
If you want, I can also provide:
- a sample REST API spec for procurement approvals,
- a workflow diagram, or
- an example using Temporal / Camunda / AWS Step Functions.