Skip to main content
Beta
Agent Sessions is in private preview. The feature is enabled per workspace by the Orq.ai team and the API is not part of the public SDKs yet. Behavior and field names can still change.
A loop belongs to a factory and starts a coding session for every run. Manage loops under Factories > the factory > Loops.

Configuration

Triggers

A loop has up to 10 triggers and any of them starts a run. A loop can have none.
  • GitHub events: an event of a connected GitHub source, optionally scoped (for example to a repository) and filtered by conditions on the event payload, such as author_association. Events caused by the factory’s own GitHub App are ignored unless include_app_events is set.
  • Schedules: hourly, daily, weekly or monthly, in an IANA time zone (UTC by default), with an optional end time.
  • Webhooks: POST requests to the trigger’s URL. The secret goes in the X-Webhook-Secret header or the ?secret= query parameter, and is shown once when the trigger is created or rotated. Other methods are not routed, and a request whose conditions do not match is accepted and ignored.
  • Manual: any active loop can be run by hand, with or without triggers. The run has trigger_id manual and the optional input is available as {{event.input}}. A paused or archived loop cannot be run by hand.
A run started by an event from a connected repository also clones that repository, first in the run’s workspace and through the trigger’s connection, with the loop’s event_repository settings. A fixed repository that names the same repository takes its place. The run fails with the event names no repository when the event carries none. Schedule, webhook and manual runs clone only the fixed repositories. An archived factory stops all of its loops from firing.

Limits

Server defaults, not editable in the UI.

Runs

Every firing is recorded as a run with a status: queued, running, completed, failed or skipped. A skipped run has no session and a skip_reason: The Sessions tab of a loop lists its runs with their event, status and linked session.

Templates

Loops offers a gallery of predefined templates. Choosing one prefills a new loop with its triggers, instructions and system instructions. Skills and MCP gateways are workspace-specific and stay empty. Trigger connections and repository connections are seeded with your first active connection of the provider. An event template works on the repository its event names and adds no repository row, while a schedule or webhook template that works on GitHub adds an empty repository row that has to be picked before saving. A template whose trigger needs a provider that is not connected asks to connect it first.

API