Skip to main content

Action context

These properties and methods are on the ctx object which is available to every action.

ctx also contains the following information about the currently running action:

  • action.slug: The action's slug
  • action.url: The absolute URL to access the action
  • environment: The environment the action is running within
  • organization.name: The name of the action's organization
  • organization.slug: The slug of the action's organization
  • params: A key/value object containing the query string URL parameters of the running action
  • user.email: The email of the person running the action
  • user.firstName: The first name of the person running the action
  • user.lastName: The last name of the person running the action

log

Logs anything from your action by printing a message in the Interval dashboard. Works with multiple arguments like JavaScript’s console.log. Logs are truncated at 10,000 characters.

notify

Sends a custom notification to Interval users via email or Slack. To send Slack notifications, you'll need to connect your Slack workspace to the Interval app in your organization settings.

redirect

Perform a redirect to another action or an external URL in the

loading.start

Kicks off a loading spinner to provide context during any long-running action work. Can also be called with a single string argument as the title, or with no arguments to display only a spinner.

loading.update

Updates any existing loading spinner initated with ctx.loading.start to dynamically provide new loading information to the action runner.

loading.completeOne

Marks a chunk of work as completed to dynamically provide granular loading progress. Can only be used after ctx.loading.start was called with itemsInQueue.

Did this section clearly explain what you wanted to learn?