Control Flow

Control Flow blocks that are available in the Plugin Editor.

❗️

This is only applicable to Plugin Workspace post-April 2025

Plugin Decision Policy


What is a Plugin Decision Policy? How should it be used?

A Plugin Decision Policy executes a set of process blocks in the plugin if a condition is met. Learn more about policies here.

This policy block effectively controls the decision making process of AI agents. It's meant to emulate the decision making process of humans.

For example, your organization might have a policy that flights must be booked at least 7 days in advance. You can use a decision policy to split the AI agent's process.

  • If more than 7 days, the AI agent can book the flight for the user.
  • If less than 7 days, the AI agent can collect an approval from a skip manager, and then book the flight.
  • If less than 3 days, the AI agent can inform the user to book the flight with a personal card & submit a reimbursement request.

Anatomy of a Decision Policy

  • Required Slots - a the set of slots which must be collected before making the decision.

  • Cases - Each case executes a series of process blocks if a DSL expression evaluates to true

  • Default - The series of process blocks to execute if none of the cases evaluate to true

Exit Block

  • does nothing. we need this if we require a “default” clause to every switch statement, which many languages require. If someone doesn’t want to do anything in the default case, great news - they can put a noop in the default!

Continue Block

  • Continue Block exits the whole program. Critical for control flow, especially if users want to exit after one branch in a nested switch statement, but other branches in that switch don’t exit.
    Exit is NOT in charge of returning data, btw (data is “returned” via activities!). It is just an exit() call.