The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "wfcb-circuit-breaker-reset-00000",
"name": "WF-CB-circuit-breaker-reset",
"nodes": [
{
"parameters": {
"rule": {
"interval": [
{
"field": "cronExpression",
"expression": "*/15 * * * *"
}
]
}
},
"id": "ccb00000-0000-0000-0000-000000000001",
"name": "Schedule 15min",
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.2,
"position": [
240,
300
]
},
{
"parameters": {
"operation": "executeQuery",
"query": "UPDATE providers SET health = 'healthy', failure_count = 0, updated_at = NOW() WHERE health = 'degraded' AND updated_at < NOW() - INTERVAL '15 minutes'",
"options": {}
},
"id": "ccb00000-0000-0000-0000-000000000002",
"name": "Reset Degraded Providers",
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.5,
"position": [
460,
300
],
"credentials": {
"postgres": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "executeQuery",
"query": "UPDATE providers SET rpm_used = 0, last_rpm_reset = NOW() WHERE last_rpm_reset < NOW() - INTERVAL '1 minute'",
"options": {}
},
"id": "ccb00000-0000-0000-0000-000000000003",
"name": "Reset RPM Counters",
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.5,
"position": [
680,
300
],
"credentials": {
"postgres": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "executeQuery",
"query": "INSERT INTO provider_metrics (provider_id, window_start, window_end, window_minutes, total_requests, successful, rate_limited, errors, timeouts, avg_latency_ms, p95_latency_ms, failover_count, total_cost_usd, total_input_tokens, total_output_tokens, json_parse_failures) SELECT provider_id, NOW() - INTERVAL '15 minutes' AS window_start, NOW() AS window_end, 15 AS window_minutes, COUNT(*) AS total_requests, COUNT(*) FILTER (WHERE status = 'success') AS successful, COUNT(*) FILTER (WHERE status = 'rate_limited') AS rate_limited, COUNT(*) FILTER (WHERE status = 'error') AS errors, COUNT(*) FILTER (WHERE status = 'timeout') AS timeouts, AVG(latency_ms)::INTEGER AS avg_latency_ms, PERCENTILE_CONT(0.95) WITHIN GROUP (ORDER BY latency_ms)::INTEGER AS p95_latency_ms, 0 AS failover_count, SUM(cost_usd) AS total_cost_usd, SUM(input_tokens) AS total_input_tokens, SUM(output_tokens) AS total_output_tokens, 0 AS json_parse_failures FROM provider_usage_logs WHERE created_at >= NOW() - INTERVAL '15 minutes' GROUP BY provider_id",
"options": {}
},
"id": "ccb00000-0000-0000-0000-000000000004",
"name": "Emit Provider Metrics",
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.5,
"position": [
900,
300
],
"credentials": {
"postgres": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"rule": {
"interval": [
{
"field": "cronExpression",
"expression": "0 0 * * *"
}
]
}
},
"id": "ccb00000-0000-0000-0000-000000000005",
"name": "Schedule Daily Midnight UTC",
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.2,
"position": [
240,
500
]
},
{
"parameters": {
"operation": "executeQuery",
"query": "UPDATE providers SET daily_used = 0, last_day_reset = NOW()",
"options": {}
},
"id": "ccb00000-0000-0000-0000-000000000006",
"name": "Reset Daily Usage",
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.5,
"position": [
460,
500
],
"credentials": {
"postgres": {
"name": "<your credential>"
}
}
}
],
"connections": {
"Schedule 15min": {
"main": [
[
{
"node": "Reset Degraded Providers",
"type": "main",
"index": 0
}
]
]
},
"Reset Degraded Providers": {
"main": [
[
{
"node": "Reset RPM Counters",
"type": "main",
"index": 0
}
]
]
},
"Reset RPM Counters": {
"main": [
[
{
"node": "Emit Provider Metrics",
"type": "main",
"index": 0
}
]
]
},
"Schedule Daily Midnight UTC": {
"main": [
[
{
"node": "Reset Daily Usage",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1"
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
postgres
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
WF-CB-circuit-breaker-reset. Uses postgres. Scheduled trigger; 6 nodes.
Source: https://github.com/navin-labs/content-factory-os/blob/main/n8n/workflows/main/WF-CB-circuit-breaker-reset.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Synchronize your Google Sheets with Postgres. Uses googleSheets, postgres, stopAndError. Scheduled trigger; 11 nodes.
Synchronize Your Google Sheets With Postgres. Uses scheduleTrigger, compareDatasets, splitOut, googleSheets. Scheduled trigger; 10 nodes.
Synchronize your Google Sheets with Postgres. Uses scheduleTrigger, compareDatasets, splitOut, googleSheets. Scheduled trigger; 10 nodes.
QuepasaAutomatic. Uses postgres. Scheduled trigger; 6 nodes.