Skip to main content
Slack and Teams

Routines

Schedule a prompt that Qubit runs for you on a timetable, or when a ticket event or Q-Notice rule happens, and posts to the channel or chat where you created it.

Written By Chris Scaminaci

Last updated About 2 hours ago

A routine is a prompt that Qubit runs by itself and posts to the channel or chat where you created it. Use one for a summary you would otherwise ask for every morning, such as the open tickets for a client. A routine runs as you, with nobody watching, and you manage it with the routine command in Slack or Teams.

Before you start:

  • Qubit must be switched on for your Slack workspace or Teams tenant.
  • You must be linked. Without a link, routine answers Routines run with your identity, so please link your account first (link). See Linking your Slack or Teams account.
  • In Slack, create a routine in a channel Qubit is in, or in your direct message with Qubit. A routine posts into the conversation where you created it, and Qubit cannot post into a direct message between two people, so Qubit refuses to create one there.
  • In Teams, create a routine in your personal chat, or in a chat or channel where you have mentioned Qubit.

Create a routine

Type routine add, then a schedule, then ::, then the prompt.

routine add weekdays at 08:00 :: Post the stale-ticket summary for Contoso

You can use a colon after the schedule instead of ::, as long as the colon is not part of a time. Qubit confirms with the routine's short id, its schedule and time zone, your prompt, and when it next runs (in UTC). routine list shows the id again later.

Times use your organisation's Display Time Zone, which an Administrator sets in Tenant settings, as it stood when you created the routine. The confirmation shows the zone that was applied. The time zone stays with that routine. If the setting changes later, routines you already made keep theirs. A time such as 08:00 stays 08:00 through daylight saving changes.

Choose a schedule

WriteThe routine runsNotes
every 30 minutesEvery 30 minutesFrom 5 to 1440 minutes
every 2 hoursEvery 2 hoursUp to 168 hours
hourlyEvery hourevery hour also works
daily at 08:00Every day at 08:00every day at and each day at also work
weekdays at 08:00Monday to Friday at 08:00every weekday at 8am also works
weekly on monday at 09:30Every Monday at 09:30every monday at 09:30 also works; three-letter day names such as mon work

Write the time as 24-hour (08:00, 8:30) or 12-hour (8am, 6:30pm). Minute and hour schedules count from the moment you create the routine.

If Qubit cannot read the schedule, it answers I couldn't read that schedule and says why, for example that minute intervals must be at least 5 minutes. A routine cannot run more often than every 5 minutes.

List and remove your routines

  • routine list, or routine on its own, shows your routines. Each line has the short id, (paused) when it is paused, the schedule, the start of the prompt, when it next runs or on event, and the result of its last run.
  • routine remove <id> removes one. Give at least the first 4 characters of the id. routine delete works the same way.

Qubit answers No routine matches that id. when nothing matches, That prefix matches several routines; add more characters. when the start is not enough, and That routine belongs to someone else. for a routine you did not create. You see and remove only your own routines, and only the ones you created in the same app: a routine made in Slack is listed and removed from Slack, one made in Teams from Teams. Removing a Slack routine from Teams answers No routine matches that id. Administrators see every routine; see below.

What happens when a routine runs

  • Qubit runs the prompt as you, with the tools your link gives you. If you are linked only through the agent mapping, a routine uses the shared tools and never your own connections.
  • The post appears in the channel or chat where you created the routine, under a heading that names the routine and its schedule. In Slack, a routine posts into the channel itself and not into a thread.
  • A routine cannot ask you anything. When a tool needs approval, the routine says what it would have done instead of doing it.
  • Charts and files the routine makes are posted after its text.
  • A routine starts within about a minute of its time.
  • A run that fails or is skipped waits for the next scheduled time. It does not retry.
  • A routine is skipped while Qubit is switched off for that channel, and when you have unlinked your account. It runs again at its next scheduled time once Qubit is back on or you have linked again. An Administrator can also remove it.

Create an event routine

An event routine runs when something happens instead of at a set time. Available when enabled for your organisation. Until then, Qubit still creates it, but the confirmation warns that event routines are switched off and the routine does not fire.

Type routine add when, then the event, then a colon, then the prompt.

routine add when a P1 is created for Contoso: post a summary here
routine add when a ticket is closed for team Service Desk: list what was done
routine add when rule "Stale P1s" fires: post the ticket and who owns it

For a ticket event, Qubit understands these:

  • the event: created (also opened, logged, raised), updated (also changed, modified) or closed (also resolved, completed);
  • a priority from P1 to P5, written like P1;
  • a ticket type, written as a word before ticket such as incident;
  • a client, written for Contoso, or a team, written for team Service Desk.

Every filter you give must match, and a filter you leave out matches anything. Names match on part of the name, whatever the case.

For a Q-Notice rule, write when rule "<name>" fires, or when a Q-Notice fires for any rule. See Q-Notice auto-rules.

What to know about event routines:

  • Qubit gets the facts of the ticket or notice as information only. Text written in a ticket is never treated as an instruction.
  • A routine runs at most once for the same event within 10 minutes.
  • Under heavy load, some events can be skipped. Use a routine as a heads-up, not as a record.
  • If Qubit cannot read the event, it answers I couldn't read that trigger with an example. Remember the colon between the event and the prompt.

What Administrators can do

Administrators see everyone's routines on the Channel Assistant page: the schedule or event, where it posts, the prompt, the next run, and the last status, for example skipped with the reason. They can pause, resume and remove any routine. See Channel Assistant settings.