Queued actions
Interval supports enqueuing actions using interval.enqueue(). Queued actions appear at the top of the Dashboard and include the name of the action, the params passed into the action (if any), and a button to run or cancel the action. Queued actions are automatically removed from the list after they're run or canceled, or if they're programmatically canceled using interval.dequeue().
Queued actions can be assigned to a specific user by their email address. Queued actions assigned to a user will only be visible to that user.
Usage
- TypeScript
- JavaScript
const queuedAction = await interval.enqueue("moderate_comment", {
assignee: "alex@interval.com",
params: {
commentId: "fzlGEIA82Yf27FgB2WAAQ",
},
});
// Optionally cancel a queued action by its ID:
await interval.dequeue(queuedAction.id);
info
The enqueue and dequeue methods are available as interval.actions.enqueue and interval.actions.dequeue on SDK versions prior to 0.38.0.
const queuedAction = await interval.enqueue("moderate_comment", {
assignee: "alex@interval.com",
params: {
commentId: "fzlGEIA82Yf27FgB2WAAQ",
},
});
// Optionally cancel a queued action by its ID:
await interval.dequeue(queuedAction.id);
info
The enqueue and dequeue methods are available as interval.actions.enqueue and interval.actions.dequeue on SDK versions prior to 0.38.0.
Props
- TypeScript
- JavaScript
assignee
Optional
string
params
Optional
Record<string, any>
Returns
object
assignee
string | undefined
id
string
params
object
assignee
Optional
string
params
Optional
Record<string, any>
Returns
object
assignee
string | undefined
id
string
params
object