Skip to main content
An opportunity-scanning loop is a scheduled evidence review. On each tick, an AI client re-runs a bounded scan of the Process Index, compares the result with its last checkpoint, and reports signals that are new or better supported. This is not workflow automation. The loop watches for opportunities; it does not perform the work inside a candidate process. The schedule, checkpoint, and notification live in your AI client or automation platform. The Within MCP supplies read-only process evidence.

When the loop fits

Use it for continuing visibility

A transformation owner wants to know when new capture changes the opportunity set, without repeating a manual review of the whole index.

Use another pattern for execution

If the goal is to perform a known workflow on a schedule, build an Integration Flow or agent instead. An opportunity loop only identifies and sizes candidates.

Define the optimization function

The prompt needs a stable answer to β€œWhat should this scan prioritize?” Without it, each tick can rank the same evidence differently and create noise. Define:
  • The business objective the scan should support
  • The process scope and patterns worth looking for
  • The evidence threshold for reporting a signal
  • The constraints that disqualify a candidate
  • What counts as a meaningful change from the prior checkpoint
Keep the optimization function stable between ticks. If the objective changes, start a new baseline instead of comparing unlike scans.

Sample routine prompt

This prompt uses a fictional logistics workspace. The scheduler supplies cycle_index, max_cycles, and the prior checkpoint to the routine; those are routine state, not Within MCP arguments.

Tool-call chain for each tick

The example calls below use synthetic resource keys. The argument names match the Within MCP tool contract.
Run the detail and observation calls for each leaf in bounded parallel batches. Use get_observation_citation only for the strongest signals rather than loading every activity timeline. The routine compares returned observation keys or timestamps with its saved checkpoint; the MCP does not store loop state. If hierarchy browsing is too broad, start with search_processes using a pattern query and then run the same detail and observation calls on the matches. The full one-time scan is documented in Find transformation opportunities.

Bound every tick

Each tick needs an exit rule as well as a schedule. Repeated retries do not create new evidence. When the maximum cycle count is reached, escalate with the last valid checkpoint intact.

Limits

The loop’s value tracks capture. When capture stops, the candidate set stops learning. A routine can keep running against old evidence and still produce a fresh timestamp, so every result should state the newest observation it used.
Sparse coverage is a result, not a reason to fill the gap with assumptions. Report which processes lack enough observations and what additional capture would make the next scan useful.