Automate

Automate

Make your phone or tablet smarter with automation

Get it on Google Play

Fork

A special block that starts a new fiber by copying the state of the current one.

Both the current and the newly created fiber will proceed immediately without pause and run simultaneously.

This block has both an OK and a NEW outcome. The NEW path is executed by the newly created child fiber, the OK path is executed, as usual, by the current (parent) fiber.

The child fiber will run independently but can be stopped from the forking (parent) fiber using the Fiber stop block. Variable values are also independent, the newly created child fiber starts with a clone of the parent fiber variables, so modifying a variable in one fiber doesn’t affect the other fiber.

Since a fiber has little use of its own URI, the child fiber URI output variable is only assigned in the forking (parent) fiber, and the parent fiber URI in the newly created (child) fiber.

Note! The NEW path should never reconnect back to the main path in the parent fiber since it will exponentially create more and more fibers.

Usage examples

  • Create a reusable procedure that doesn’t return a result, use the subroutine block if a result is expected.
  • Perform a lengthy task, like uploading files to Google Drive, without blocking the current fiber.
  • Perform a network task that may fail, without having the “main” fiber stopped.
  • Await more than one decision blocks within the same flow.
  • Show multiple notifications in the same flow.

Options

  • Stop with parent — whether the newly created (child) fiber should also stop when forking (parent) fiber stops.

Output variables

  • Child fiber URI — variable in forking (parent) fiber assign the URI of the newly created (child) fiber.
  • Parent fiber URI — variable in the newly created (child) fiber assign the URI of the forking (parent) fiber.
Note! This documentation can also be found in the Help & feedback menu of the app.