Skip to main content

Back-to-back loops

Use back-to-back loops when one list must finish before another starts, with any intermediate work between them. This example processes two lists of three quotes. It sends each item to Launch Console, logs First list complete between the loops, then logs Both lists complete after the second loop exits.

Watch the walkthrough, then use the template and key settings below as you follow along.

Copy the demonstrated Wrkflow​

Click Copy template, open a Wrkflow in the Designer, and paste with Ctrl + V on Windows or Cmd + V on Mac.

Connect Start to the first Loop through JSON array. The template includes both sample lists and does not need an API connection. You can replace the lists or add your own Wrk Actions between the loops.

Key settings​

Each loop uses its own Loop through JSON array and matching Continue loop. Keep the Loop ID and Continue loop ID mappings paired within each loop.

Wrk ActionSetting
First Loop through JSON arrayUse the first sample list as JSON Array. Map the first Continue loop's Continue loop ID into its Continue loop ID input.
First item Send to Launch ConsoleUse Info, with Notification Content set to the first array loop's quote custom output. Connect Success to the first Continue loop.
First Continue loopSet Loop ID to the first array loop's Loop ID. Connect Continue back to that array loop and Exit to the checkpoint logger.
Checkpoint Send to Launch ConsoleUse Info with First list complete, then connect to the second array loop.
Second Loop through JSON arrayUse the second sample list as JSON Array. Map the second Continue loop's Continue loop ID into its Continue loop ID input.
Second item Send to Launch ConsoleUse Info, with Notification Content set to the second array loop's quote custom output. Connect Success to the second Continue loop.
Second Continue loopSet Loop ID to the second array loop's Loop ID. Connect Continue back to that array loop and Exit to the final logger.
Final Send to Launch ConsoleUse Info with Both lists complete.

Each list contains objects with a dialog field. On both array Wrk Actions, extract $.dialog from Item value into a Text (short) custom output named quote. The item loggers use that quote output so the console shows the quote text rather than the full object.

The Continue loop ID input is optional when starting fresh, but configure it on each array loop so Continue loop can resume that loop. When a loop exits, its Continue loop ID output is blank. The next loop can start with its usual mappings; no separate reset step is needed.

The loops run in sequence. Nested loops places an item loop inside each iteration of a page loop. Here, the entire first loop finishes before the second begins.

Check the result​

Save and launch the Wrkflow. In execution order, expect:

  1. Three item messages from the first list.
  2. First list complete once.
  3. Three item messages from the second list.
  4. Both lists complete once.

Launch Console shows newer messages first; use timestamps to follow the execution order.

Troubleshooting​

  • Only one item appears from a list: check that loop's Continue return connection and both ID mappings.
  • The second list starts too early: connect it after the first loop's Exit outcome, through the checkpoint logger.
  • The wrong list resumes: check each array's sample values and keep its mappings paired with the matching Continue loop.
  • Quote messages are empty: confirm both array Wrk Actions extract quote from Item value using $.dialog, and each item logger uses its loop's quote output.
  • The final message is missing: connect the second Continue loop's Exit outcome to the final logger.