Example n8n workflow
Usage check before chat completion.
On this page
Example: pool-gated chat workflow
- Schedule Trigger — run hourly
- Caedral → Get Usage — read pools.external.percentUsed (or caedral pool)
- IF — continue only if percentUsed < 100 (or on-demand enabled)
- Caedral → Chat Completion — model deepseek/deepseek-v4-flash, Simple message mode
- Slack or Email — send {{ $json.content }} from the chat response
Chat Completion options
| Field | Description |
|---|---|
| Model | Any live catalog ID (example: deepseek/deepseek-v4-flash). Free-tier models cost $0 with an active subscription. |
| Message Input Mode | Simple — single user message; JSON — full messages array |
| Temperature | Optional, 0–2 |
| Max Tokens | Optional; 0 omits the field from the request |
Output fields (Chat Completion)
- content — assistant reply text
- model — model ID used
- finishReason — stop reason from the gateway
- usage — prompt_tokens, completion_tokens, total_tokens
- raw — full gateway JSON response
Output fields (Get Usage)
- accountStatus — active | payment_pending
- plan — id, name, interval, status
- pools.caedral / pools.external — usedMilli, limitMilli, percentUsed