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 suppliescycle_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.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.

