Skip to main content
Beta
Loops are in beta and require the Developer Toolkit. To join the beta, email [email protected].

Loops

When your PSA can track the state of the work, it is the system of record. Your automations read the ticket, update it, and the PSA remembers where things stand. Most of what you build in MSPintegrations works this way, and it works well.

Some work goes beyond what your PSA can track:

  • Two PSAs are involved. When you keep tickets in sync between two PSAs, one side has to be the master. Neither PSA can hold the state of the pair by itself.
  • The work is not a ticket. A sales conversation by email, a quote waiting for a signature, or a vendor date does not need a ticket, but someone still has to remember where it stands.
  • The process takes many steps over days or weeks. Onboarding a new client means creating records, waiting, following up, and checking that nothing stalled.

A loop is the system of record for that work. It is a record that stays open for as long as the work does, remembers where the work stands, checks on it on a schedule, and hears about new developments from your email rules, forms, scheduled tasks, and PSA workflows. When something happens, or when nothing happens for too long, the loop runs the steps you chose.

Keep the Whole Process in One Place​

A loop type holds the state of the work and all of its logic: the stages, the actions that run in each stage, the schedule that checks on it, and the events other automations can send it.

Without a loop, a multi-step process against a ticket usually becomes several separate automations that each do one part at a different time. You might have an email rule that creates the ticket, another rule that updates it, a scheduled task that checks it every morning, and a PSA workflow rule that emails MSPintegrations when a status changes. Each piece works, but nobody can see the whole process in one place.

With a loop, that process lives on one loop type:

Without a loopWith a loop
Several email rules, scheduled tasks, and PSA workflow rules each change the same ticket.One loop type has every stage and every step.
A scheduled task scans your PSA to find work that is waiting.Each loop wakes itself on its own schedule.
You piece together what happened from the PSA and several histories.Each loop has its own timeline, with a link to every run.

Your email rules, forms, and PSA workflows stay small: they find the right loop and tell it what happened, usually by sending an event. The loop type decides what that means.

Even a workflow that a single email rule could handle can move onto a loop when you want to wait before a step, react differently to a later email, or run a series of steps over several days.

What You Can Build With Loops​

Each example below is one arrangement of the same building blocks: a loop type with stages, a wake schedule that checks on the loop, and the automations you already have telling the loop what happened. Loop Designs for Common Work walks through the first four designs stage by stage.

SituationHow a loop handles it
Onboard a new client. Onboarding takes several steps over weeks, and it stalls between them.A form submission opens a loop. Its first stage creates the company, contract, and contact in your PSA and adds the service. The next stage wakes a week later and sends a follow-up email. Later stages continue the process, and each stage wakes weekly to flag a step that has stalled.
Keep two PSAs in sync. A ticket in one PSA has a matching ticket in another, and one side has to be the master.Keep one loop per ticket pair, with each side's ticket ID in its fields. PSA workflows on each side send events such as Note added to the loop, and the loop type's event steps copy the change to the other side.
Follow up on sales opportunities without a CRM. Inquiries, demo bookings, and trial sign-ups arrive by email, and some go quiet.Each prospect's first email opens a loop, so you never enter leads anywhere. The loop knows whose turn it is. When the prospect goes quiet or you forget to reply, it brings the opportunity back with a drafted next email.
Track what you owe, even when no bill arrives. Some vendors send a bill, some never do, and some are on autopay. The payment is due either way.Keep one loop per obligation. A bill email marks the cycle as received. If no bill has arrived a week before the due date, the loop reminds you to pay or to log in and check. For autopay, it reminds you to confirm the payment after the due date.
Chase customers who stop replying. A ticket waits on the customer, and nobody follows up.Open a loop when the ticket starts waiting. A Waiting on customer stage wakes every 2 days and sends a reminder. After the third reminder, the loop moves to a No response stage that updates the ticket and closes the loop. When the customer replies, an event closes the loop early.
Notice the email that never came. A nightly backup job hangs, so neither a success nor a failure email arrives, and no ticket is created.Keep one loop per backup job. Each success email moves the loop back into its Healthy stage, which restarts the wait. If 26 hours pass without a success email, the stage wakes and creates a ticket. See Create a Ticket When an Expected Email Does Not Arrive.

When one automation is enough​

  • Your PSA already tracks the state, and the work finishes in one run. If an email rule or form can do everything right away and the ticket shows where things stand, a single automation is enough. Move it onto a loop when you want delays, later follow-ups, or the whole process in one place.
  • The same job on a timetable. To run the same check every morning across your PSA, use a Scheduled Task. Use a loop when each customer, ticket, or job needs its own clock and its own history.
  • Repeating steps over a list. To run steps once for each item in a list, such as each ticket number in an email, use Iterate. Iterate repeats steps within one run; a loop tracks one piece of work across many runs.

Loops in the Console​

You define what a kind of work looks like (a loop type), then your automations open loops of that type and move them from stage to stage. The rest of this page shows where everything lives in the console and how to build your first loop type. For the ideas behind loops (stages, wakes, events, closing, and fields) and for the actions that work with them, see How Loops Work.

Click Apps in the top bar, then click Loops. If you do not see Loops, your account is not in the beta yet. Loops require the Developer Toolkit.

The Loops Sidebar​

Sidebar itemWhat you do there
All LoopsBrowse your loops, filter them by loop type, stage, and Status (open, closed, or both), and open one to see its details. Choose a loop type before filtering by stage. Click Open Loop to start a loop by hand.
Loop TypesCreate and edit loop types. Click New loop type to start one.
Global FieldsDefine fields that any loop type can use. Click New global field to add one.
Loop HistoryReview every run of every loop and what its actions did.

Build a Loop Type​

Start with the smallest loop type that does something useful, then add to it.

  1. Click Loop Types in the sidebar, then click New loop type.
  2. Enter a Name, for example Inside Sales.
  3. On the Fields tab, click Add field under Fields of this loop type. For a sales conversation, add a Text field named customer_email and select Indexed so automations can find the loop by email address. Select Hidden on a field that holds a value people do not need to see, such as a counter.
  4. On the Stages tab, a new loop type already has one stage. Enter its Stage name (for example Waiting for customer) and choose its wake schedule. Select Wake on a schedule, then enter how often, such as every 7 days.
  5. Add actions to the stage. The When entered list runs each time a loop enters the stage. The When woken list runs on each wake.
  6. Click Add stage to add more stages, such as Customer replied and Won, and add actions that move the loop between them. For example, a final Won stage can use Close Loop in its When entered list.
  7. Click Create to save the new loop type. When you edit it later, click Update and Close, or choose Update from the button's menu to keep editing.

The first stage in the list is the stage a new loop starts in. A stage keeps its identity when you rename it, so loops in it stay in it.

Add events to a loop type​

Events let other automations tell a loop that something happened, while the handling steps stay on the loop type. To add one:

  1. Open the loop type and click the Events tab.
  2. Click Add event and enter an Event name, for example Email received.
  3. Click Add Field for each input, a value that comes with the event. The field editor opens in a dialog. Enter a name (for example from_address), a label, and a type, and select Required if the event cannot be sent without it. Choice inputs need their options. Names use letters, numbers, and underscores, and cannot start with a number. Each input then shows as a collapsed row; use Edit on the row to change it again, or its other row actions to clone or delete it.
  4. Next to Actions, click Edit and add the steps that run when the event reaches a loop. In these steps, {{input.from_address}} is the value of the input, and {{meta.loop.event.name}} is the event name.
  5. Click Update and Close to save the loop type.

The event's steps run in the stage the loop is in when the event runs. They do not move the loop or change its wake schedule unless you add an action that does. You can delete an event at any time.

To send an event from another automation, use Send Loop Event. For how events behave, see Events.

Connect an email to a loop​

Loops open from other automations. To start a loop from an incoming email, add Find or Open Loop to the email rule. Match on customer_email with the sender's address. The first email opens a loop. Later emails from the same address find that loop. A following Move Loop to Stage can move it, or a Send Loop Event can tell the loop about the email so the loop type decides what to do.

Fields​

Each loop type has its own fields, and the Global fields section of the loop type lists the global fields it uses. Use a global field when several loop types track the same fact, such as a ticket ID.

  • You can rename a field or change its Display name at any time. Stored values stay with the field.
  • You cannot change a field's type after you save it.
  • A loop type's field and a global field it uses cannot share a name.
  • A choice field's options can be narrowed per loop type when you add the global field to it.
  • You cannot delete a global field while a loop type uses it.

Field names use lowercase letters, numbers, and underscores, start with a letter, and can be up to 64 characters long.

When you turn on Indexed for a field, matching on that field covers the loops you already have. An indexed value can be at most 191 characters long, so a loop that already holds a longer value in that field cannot be found by it. Open the loop from All Loops and shorten the value with Edit data if you need to find it by that field.

Loop Details​

Open a loop from All Loops to see:

SectionWhat it shows
SummaryTitle, loop type, stage, open or closed, when it entered the stage, and when it wakes next.
DataThe values of its fields. Click Edit data to change them. Hidden fields do not appear.
TimelineWhen the loop opened, entered a stage (including the first stage and re-entering the same stage), closed, or reopened, and the notes your automations added. Notes also explain events or moves that were dropped, for example because the loop was closed. Click View run to see the run that wrote an entry.
FilesThe files saved on the loop. You can download them.
Recent runsThe latest runs, with their status and the reason they ran.

The buttons at the top (Move stage, Wake, Send event, Edit data, Close, Reopen, and Delete) change the loop by hand. These make the same requests the loop actions make, so a loop that is busy finishes its current run first.

Click Send event and choose one of the loop type's events (the button opens the event directly when the loop type has only one). Fill in the event's inputs in the same dialog you use to test macros and forms, then click Send Event. The dialog shows the run's log as the event's steps run. If the loop is busy, the dialog tells you the event is queued; it runs when the loop's current run finishes. The button is off when the loop is closed or the loop type has no events.

A closed loop shows Reopen instead of Close, and its move, wake, send event, and edit buttons are off until you reopen it.

Limits to Know About​

  • You cannot remove a stage while any loop, open or closed, is in it. The console tells you how many loops are in the stage. Move or delete those loops first.
  • You cannot delete a loop type that has loops.
  • Deleting a loop deletes its data, timeline, and files and cannot be undone.
  • A stage with a wake schedule runs its When woken actions on every wake, and each run counts like any other run in History.