Analyze Draft Feedback
Proposal Workflow
Analyze Draft Feedback
POST
Analyze Draft Feedback
Overview
Analyzes the uploaded draft proposal document against RFP requirements and provides section-by-section feedback. This is Step 4 in the proposal workflow, helping users refine their draft before final submission.Workflow Pattern
Follows the asynchronous Lambda worker pattern:- Upload Draft: User uploads draft proposal via
/upload-draft-proposal - Trigger Analysis: POST to
/analyze-draft-feedbackstarts analysis - Lambda Worker: Backend invokes worker with
analysis_type: "draft_feedback" - Polling: Poll GET
/draft-feedback-statusfor completion - Review Feedback: Display section-by-section recommendations
Request
The proposal ID or code (format:
PROP-YYYYMMDD-XXXX)If
true, forces a new analysis even if one already exists. Use this when the draft has been re-uploaded or significantly edited.Response
processing: Analysis started successfullycompleted: Analysis already exists (cached)
User-friendly status message
ISO 8601 timestamp when analysis started
true if returning cached resultsFeedback analysis (only present if cached)
Example Request
Example Response
First Call (Processing)
With Cached Result
Upload Draft First
Before triggering feedback analysis, upload the draft document:POST /api/proposals/{proposal_id}/upload-draft-proposal
Upload draft proposal document (PDF, DOC, or DOCX)
Upload Example
Force Re-analysis
When a user uploads a revised draft, useforce: true:
What Force Re-analysis Clears
Status Values
Theanalysis_status_draft_feedback field tracks analysis state:
| Status | Description |
|---|---|
not_started | No analysis triggered |
processing | Lambda worker is analyzing |
completed | Analysis finished successfully |
failed | Analysis encountered an error |
Polling for Status
GET /api/proposals/{proposal_id}/draft-feedback-status
Check draft feedback analysis completion status
Polling Example
Lambda Worker Details
Lambda Invocation Payload
DynamoDB Status Management
Before invocation:Error Handling
Status Code 400 - Missing RFP Analysis
Status Code 400 - No Draft Uploaded
Status Code 403
Status Code 404
Status Code 500
GET Draft Feedback Status
Description
Poll this endpoint to check draft feedback analysis completion status.Request
The proposal ID or code
Response
Current status:
not_started, processing, completed, or failedFeedback analysis results (only when completed)
ISO timestamp when analysis started
ISO timestamp when analysis completed
Error message (only when failed)
Example Response (Completed)
Example Response (Processing)
Example Response (Failed)
Displaying Feedback
Recommended UI patterns for feedback display:Overall Summary Card
Section-by-Section View
RFP Alignment Checklist
Next Steps
After reviewing feedback:- Revise Draft: Address recommendations and missing elements
- Re-upload: Upload revised draft
- Re-analyze: Trigger feedback analysis again with
force: true - Iterate: Repeat until achieving desired quality score
- Finalize: Export final proposal for submission
Deleting Draft
To remove a draft and its feedback:DELETE /api/proposals/{proposal_id}/documents/draft-proposal/{filename}
Delete draft proposal and clear feedback analysis
Best Practices
Focus on high-impact items: Prioritize recommendations that address unmet RFP requirements and low-scoring sections first.