Overview
Cuey is built on two main concepts: events and crons. Understanding these building blocks is essential for effectively using Cuey.Events
Events are one-time scheduled webhooks that execute at a specific time. Each event represents a single webhook delivery scheduled for the future.Event Lifecycle
Events progress through the following states:- Pending: The event is scheduled but has not yet executed. You can update or delete pending events.
- Processing: The event is currently being executed—the webhook is being delivered. Events enter this state up to 10 seconds before the actual delivery.
- Success: The webhook was delivered successfully and received a successful response.
- Failed: The webhook delivery failed after all retry attempts have been exhausted.
Events can be created manually for one-time execution, or they can be automatically generated by cron jobs.
Crons
Crons are recurring schedules that automatically generate new events based on a cron expression. Instead of manually creating events for recurring tasks, you create a cron job once, and Cuey automatically creates new events according to the schedule. For example, a cron job configured to run daily at 9 AM will automatically create a new event each day at that time. The cron job itself doesn’t execute webhooks—it generates events that then follow the standard event lifecycle. Think of crons as event factories: they continuously produce new events based on their schedule, timezone, and configuration.The cron guarantees there is always at least one event pending. There can be up to 20 pending events generated by a cron job at any given time.
How They Work Together
When you create a cron job, Cuey:- Creates the cron job with your specified schedule, webhook URL, payload, and configuration
- Generates the first pending event for the next scheduled execution time (this can take up to 10 seconds)
- Continues generating new events as needed to maintain the schedule
- Each generated event follows the standard event lifecycle independently
- When you update or delete a cron job, all future pending events generated by that cron are automatically deleted, and new events are created based on the updated schedule
Event generation after creating a cron job can take up to 10 seconds. If the next scheduled execution time is less than 10 seconds away, we don’t guarantee the event will be delivered, and if it is delivered, it may be late.