
Building a Serverless Procurement Approval Workflow on AWS
Learn how to use AWS Step Functions, Lambda, DynamoDB, EventBridge, and Amazon Quick Sight to automate purchase requests, improve governance, and generate procurement insights without managing servers.
Introduction
Procurement is more than purchasing goods and services. It is a business process that connects employees, suppliers, finance teams, managers, and compliance functions.
A purchase request may need to be validated, classified, approved, recorded, and monitored before an order can be created. When these activities depend on emails, spreadsheets, and manual follow-ups, the process can become slow and difficult to audit.
In this article, I present a serverless reference architecture for automating a procurement approval workflow on AWS. The solution combines workflow orchestration, event-driven integration, operational data, and analytics.
Disclaimer: This is a generic reference architecture. All request identifiers, suppliers, amounts, approval thresholds, and business rules used in this article are fictional and are not based on any specific organization.
Business Scenario
Imagine that an employee needs to purchase a professional service, software subscription, or piece of equipment.
The employee submits a purchase request containing information such as:
- Requester ID
- Cost center
- Procurement category
- Supplier ID
- Requested amount
- Currency
- Business justification
- Required delivery date
- Supporting documents
The organization may apply different approval paths according to the value, category, risk level, or cost center.
For example:
- Requests up to USD 1,000 may be approved automatically when they meet all policy requirements.
- Requests between USD 1,000 and USD 10,000 may require manager approval.
- Requests above USD 10,000 may require both manager and Procurement approval.
- Restricted categories may require an additional compliance review.
These thresholds are only examples. In a real implementation, the rules must reflect the organization’s procurement policy and internal controls.
Reference Architecture
The proposed architecture uses the following AWS services:
- Amazon API Gateway receives purchase requests from a web or mobile application.
- AWS Lambda validates the request and applies business rules.
- Amazon DynamoDB stores the current status and operational information for each request.
- AWS Step Functions orchestrates validation, approval, rejection, escalation, and notification activities.
- Amazon EventBridge distributes procurement events to other applications.
- Amazon Simple Notification Service — Amazon SNS sends notifications to requesters and approvers.
- Amazon S3 stores historical procurement events and analytical data.
- AWS Glue Data Catalog maintains the metadata used to query the analytical dataset.
- Amazon Athena runs SQL queries against procurement data stored in Amazon S3.
- Amazon Quick Sight presents procurement indicators through dashboards.
- Amazon CloudWatch monitors logs, errors, metrics, and workflow health.
- AWS CloudTrail supports auditing of AWS API activity.
AWS Step Functions can coordinate AWS service integrations and use callback patterns to pause a workflow while waiting for an external action, including a human decision. EventBridge event buses route matching events from different sources to one or more targets. Athena analyzes data stored in Amazon S3 using SQL, while Amazon Quick Sight can use analytical datasets to create visualizations and dashboards.
Purchase Request Data
A simplified purchase request could use the following JSON structure:
{ "requestId": "PR-2026-00042", "requesterId": "USER-104", "costCenter": "CC-2200", "category": "Professional Services", "supplierId": "SUP-1048", "amount": 4500, "currency": "USD", "businessJustification": "Specialized technical support for a cloud project", "requiredDate": "2026-10-15", "status": "PENDING_APPROVAL", "createdAt": "2026-08-27T13:00:00Z"}Only information required for the procurement process should be collected. Sensitive personal information, bank details, passwords, and confidential contract content should not be added to this operational record unless the architecture and security controls were specifically designed for that data.
How the Workflow Works
1. Submit the Purchase Request
The requester accesses an authenticated application and completes a purchase request form.
The application sends the request to an API Gateway endpoint, such as:
POST /purchase-requestsAPI Gateway invokes a Lambda function responsible for the initial validation.
2. Validate the Request
The validation function checks whether:
- Mandatory fields are present.
- The amount is greater than zero.
- The currency is supported.
- The cost center is valid.
- The procurement category exists.
- The supplier is eligible for the selected category.
- The requested delivery date is valid.
If the request is invalid, the application returns a clear error message to the requester.
If the request is valid, Lambda creates the request record in DynamoDB and starts the Step Functions workflow.
3. Determine the Approval Path
The workflow evaluates the procurement policy.
A Step Functions
Choice state can route the request according to attributes such as:- Purchase amount
- Procurement category
- Supplier risk classification
- Cost center
- Contract availability
- Budget status
A low-value and policy-compliant request may proceed to automatic approval. A higher-value request may be routed to a manager, Procurement specialist, or compliance reviewer.
Separating policy evaluation from the application interface makes the approval process easier to understand, test, and update.
4. Request Human Approval
When human approval is required, the workflow sends a notification containing the request ID and a link to an authenticated approval application.
The approver can review:
- The requested item or service
- The supplier
- The amount
- The business justification
- Supporting documents
- Previous approval decisions
The workflow can use the Step Functions callback pattern to wait for the decision.
The approval application should never expose the Step Functions task token directly in an unsecured URL. The token should remain in a protected backend component. After verifying the approver’s identity and authorization, the backend submits the decision to Step Functions.
The decision should include:
- Approver identity
- Decision
- Decision timestamp
- Optional comments
- Approval level
- Reason for rejection, when applicable
5. Update the Request
After the approval decision, the workflow updates the DynamoDB record.
Possible statuses include:
DRAFTSUBMITTEDPENDING_MANAGER_APPROVALPENDING_PROCUREMENT_APPROVALAPPROVEDREJECTEDCANCELLEDEXPIREDThe workflow can also apply a timeout. For example, when an approver does not respond within the required service-level target, Step Functions can send a reminder or escalate the request to another approver.
6. Publish a Procurement Event
After the request is approved or rejected, the solution publishes an event to a custom EventBridge event bus.
An approved event could look like this:
{ "source": "com.example.procurement", "detail-type": "Purchase Request Approved", "detail": { "requestId": "PR-2026-00042", "category": "Professional Services", "amount": 4500, "currency": "USD", "costCenter": "CC-2200", "approvedAt": "2026-08-27T15:30:00Z" }}EventBridge rules can route this event to different targets.
For example:
- An ERP integration can begin purchase order creation.
- A finance application can reserve the approved budget.
- A notification function can inform the requester.
- An analytics process can add the event to an Amazon S3 dataset.
- A compliance application can perform an additional control.
This event-driven design reduces direct dependencies between systems. The approval workflow does not need to understand the implementation details of every downstream application.
Procurement Analytics
Operational data becomes more valuable when it can be converted into indicators.
After procurement events are stored in Amazon S3, Athena can query them using SQL.
The following example calculates approved spend by category:
SELECT category, COUNT(*) AS approved_requests, SUM(amount) AS approved_spendFROM procurement_requestsWHERE status = 'APPROVED'GROUP BY categoryORDER BY approved_spend DESC;Another query can calculate the average approval cycle time:
SELECT category, AVG( date_diff( 'hour', submitted_at, approved_at ) ) AS average_approval_hoursFROM procurement_requestsWHERE status = 'APPROVED'GROUP BY categoryORDER BY average_approval_hours DESC;Amazon Quick Sight can use the Athena dataset to create dashboards for Procurement and Finance teams.
Useful indicators may include:
- Total requested spend
- Total approved spend
- Requests by category
- Requests by cost center
- Average approval cycle time
- Requests waiting for approval
- Rejection rate
- Percentage of automatically approved requests
- Requests outside the procurement policy
- Approval service-level target breaches
- Supplier concentration by category
These indicators can help teams identify process bottlenecks, unusual purchasing behavior, and opportunities for improvement.
Security and Governance
Procurement information can include commercially sensitive data. Security must therefore be part of the architecture from the beginning.
Apply Least-Privilege Access
Each Lambda function and Step Functions workflow should receive only the permissions required for its specific responsibilities.
For example:
- The validation function may create and read purchase requests.
- The approval function may update only approval-related attributes.
- The analytics process may read approved events but should not modify operational records.
- The notification function may publish only to the required SNS topic.
AWS recommends applying least-privilege permissions and using temporary credentials for workloads and human access.
Authenticate Requesters and Approvers
Only authenticated users should be able to submit or approve requests.
Authorization must also verify the user’s business role. Authentication confirms who the user is, while authorization confirms whether that user is allowed to approve a specific request.
Protect Data
DynamoDB encrypts data at rest, and Amazon S3 applies server-side encryption to new objects by default. Organizations that require additional control over encryption keys can evaluate customer-managed AWS KMS keys.
The solution should also:
- Require HTTPS for all application traffic.
- Block public access to procurement S3 buckets.
- Avoid writing sensitive request content to logs.
- Define data retention policies.
- Protect supporting documents with appropriate access controls.
- Separate development, testing, and production environments.
Maintain an Audit Trail
The application should record each procurement decision as a business event.
The audit history should identify:
- Who submitted the request
- Who reviewed the request
- What decision was made
- When the decision occurred
- Which policy rule was applied
- What information changed
- Which integration received the resulting event
CloudTrail provides a history of AWS API activity and can help identify the user, account, time, and source associated with supported API calls. However, CloudTrail does not replace the application-level procurement audit record. Both layers are useful for different purposes.
Enforce Separation of Duties
The architecture should prevent the same person from requesting, approving, and processing a purchase when the organization’s policy requires separation of duties.
This control should be implemented in the authorization logic and not only documented as a manual procedure.
Reliability Considerations
A procurement workflow must handle failures without creating duplicate requests or inconsistent decisions.
Recommended practices include:
- Use a unique request identifier.
- Make Lambda functions idempotent.
- Configure retries only for errors that can be retried safely.
- Use timeout and fallback states in Step Functions.
- Prevent the same approval from being processed twice.
- Configure CloudWatch alarms for failed workflow executions.
- Create dead-letter handling for asynchronous integrations.
- Store the final business decision before notifying downstream systems.
- Include correlation IDs in logs and events.
- Test rejected, expired, duplicated, and partially completed requests.
Serverless does not mean that the workload has no cost or operational responsibility. Each service has its own pricing model, quotas, logs, permissions, and monitoring requirements.
Business Benefits
This architecture can help an organization:
- Reduce manual handoffs.
- Standardize approval rules.
- Improve visibility into request status.
- Create a consistent audit history.
- Integrate Procurement with Finance and ERP applications.
- Produce data-driven procurement indicators.
- Scale the workflow without managing servers.
- Add new approval rules without redesigning the entire application.
The architecture also supports gradual adoption. An organization can begin with a single purchase category or approval process and expand the solution as the business rules mature.
Possible Next Steps
The reference architecture can be extended with:
- Supplier onboarding workflows
- Budget validation
- Contract repository integration
- Purchase order creation
- Invoice approval
- Three-way matching
- Automated document extraction
- Supplier risk monitoring
- Sustainability and responsible sourcing indicators
- Procurement policy assistants
- Integration with existing source-to-pay platforms
Infrastructure as code tools such as AWS CloudFormation or the AWS Cloud Development Kit can also be used to deploy the architecture consistently across environments.
Conclusion
Procurement transformation is not achieved by moving the same manual process to a new interface. The process must become visible, measurable, secure, and easier to integrate.
AWS Step Functions can coordinate the approval journey, Lambda can implement focused business logic, DynamoDB can maintain operational state, and EventBridge can distribute procurement events without tightly coupling every system.
Amazon S3, Athena, and Amazon Quick Sight can then transform workflow history into procurement insights.
AWS does not define an organization’s procurement policy. Instead, it provides building blocks that can turn approved policies into automated, observable, and scalable workflows.
By starting with a focused use case such as purchase request approval, teams can demonstrate value, learn from operational data, and progressively modernize the broader procurement journey.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article