OpenAI 429 Classifier: Rate Limit vs Quota Exhaustion with Batch Halt Decision
Loading workflow…
Workflow Description
Analyzes a JSON OpenAI error log and classifies each record as quota_exhausted, rate_limit, other_error or invalid_record using status, message, code and type. It computes per-category counts and ratios, then an IF node issues halt_batch when any quota error exists or the rate-limit ratio exceeds the configured threshold, otherwise continue, always with a reason. It makes no external calls and performs no retries; quota record IDs are listed for account action.
How it works
- 1.Run Manual Trigger
- 2.Code node emits six fictional error records
- 3.Classify each record, compute counts, ratios and decision reason
- 4.IF checks should_halt
- 5.Set adds decision halt_batch or continue and retry_performed=false
- 6.Merge branches and output one decision item
Use cases
- Stop OpenAI batches when credits run out
- Distinguish temporary rate limits from billing issues
- List records needing account action
Requirements
- Error log with request_id, status, message, code or type
- Set RATE_LIMIT_HALT_RATIO in the classify node
- No credentials needed
Setup and testing in n8n
- Import the JSON into n8n
- Execute and confirm halt_batch with two reasons
- Remove quota records and one rate-limit record to see continue
- Keep the empty record to verify invalid_record
Service Value
Ready-made workflow template for automation delivery and service execution.
Apps Used
Details
How to Use
- 1.Click "Download Template"
- 2.Open your n8n dashboard
- 3.Go to Workflows > Import from File
- 4.Select downloaded file and configure credentials
Nodes Used (8)
Manual Trigger
Manual Trigger
Build Sample Error Log
Code
Classify And Summarize Errors
Code
Halt Needed?
If
Set Halt Batch Decision
Set
Set Continue Decision
Set
Merge Decisions
Merge
Batch Decision Output
No Op
Note Stages
Sticky Note
Note Setup
Sticky Note
Fresh workflows, straight to your inbox
Get newly published DROPIDEA workflows, a clear overview of what they do, and a link to explore them.
- New workflows
- Clear overviews
- Setup guides