Download all docs
io

Platform Trigger

An IO trigger that listens to Triform's own event bus — element creations, run completions, state changes, and custom events other elements publish — and fires a connected flow the moment a matching one occurs, letting your circle react to itself rather than to the outside world.

Working with it

Selecting a Platform Trigger reveals its settings in the properties panel; it has no dedicated full-screen workbench.

How it appears

The same element type rendered as a definition, a circle instance, and a live workspace card.

Pg
type

Platform Trigger

Fire a flow when internal platform events occur

ioatomdefinition

When to use / not

When to use

  • Reacting to internal platform activity — fire a flow when an element is created, a run completes, or another element publishes a custom event.
  • Chaining one part of a circle to another without polling — wire a platform event pattern (e.g. "run.completed", "element.*") straight into an automation or action.
  • Narrowing what you respond to with a CEL filter or element-type filter, so the flow only fires for events that actually matter.
  • Coalescing bursts of rapid events with a debounce interval instead of firing once per event.

When not to use

  • Reacting to the outside world — for inbound HTTP, chat, email, or webhooks use the matching external IO connector (http, slack, email, …), not platform-trigger.
  • Running work on a clock rather than in response to an event — that is what the schedule trigger is for.
  • Expressing the branch/loop logic itself — platform-trigger only starts a flow on an event; use automation (condition, loop, wait) to shape what runs afterwards.

Topology

Created from the library and placed inside an app or circle. It is a top-level building block you compose with other elements.

Properties

eventsarray
Platform event patterns to watch (e.g., 'element.created', 'run.completed', 'element.*')
trigger_onstring
Event type to trigger on (e.g., 'element_change', 'run_completed'). Alias for events — sets a single event pattern.
target_refstring
Slug or path of the element to invoke when the trigger fires
target_elementstring
Slug or path of the element to watch for events
descriptionstring
Human-readable description of what this trigger does

Capabilities

Inherited from io
  • Network
  • Observe

Operations

  • activityGET
  • attachmentsGET
  • batch_statsGET
  • composePOST
  • contextGET
  • createPOST
  • deleteDELETE
  • deprovisionPOST
  • disablePOST
  • enablePOST
  • export_bundleGET
  • getGET
  • historyGET
  • import_bundlePOST
  • intentionGET
  • promotePOST
  • provisionPOST
  • readmeGET
  • readme_updatePOST
  • receivePOST
  • remove-modifierPOST
  • restorePOST
  • schemaGET
  • sendPOST
  • simulatePOST
  • sourceGET
  • source_branchesGET
  • source_promotePOST
  • source_repairPOST
  • source_statusGET
  • source_validatePOST
  • statsGET
  • test_connectionPOST
  • treeGET
  • updatePATCH
  • update_metaPATCH
  • versionGET

Ports

Inputs

  • eventevent

Composition

Errors / when it fails

events is required and must contain at least one event pattern (e.g. 'element.created', 'run.completed', 'element.*')
Fails unless: events != null && size(events) > 0
filter must not be an empty string — either omit it or provide a valid CEL expression
Fails unless: filter == null || size(filter) > 0
max_concurrency must be between 1 (minimum) and 50 (maximum)
Fails unless: max_concurrency >= 1 && max_concurrency <= 50
target_ref must not be an empty string — provide a slug or path of the element to invoke when the trigger fires
Fails unless: target_ref == null || size(target_ref) > 0

Validation rules

  • High max_concurrency (>20) may overwhelm downstream elements — confirm this is intentional
  • No CEL filter set — trigger will fire on every matching event_name; add a filter expression to reduce noise if events are high-frequency
  • Trigger is disabled (enabled=false) — provision will be a no-op until enabled is set back to true

Platform Trigger (platform-trigger)

Category: io | Form: | Symbol: Pg

Fire a flow when internal platform events occur

Fires a connected flow when internal platform events occur. Set spec.events to the list of event patterns to watch (e.g., “element.created”, “run.completed”, “element.*”). Optional spec.filter is a CEL expression evaluated against the event payload — the flow only fires when it returns true. Optional spec.element_type_filter restricts to events for a specific element type. Use provision to begin watching and deprovision to pause. The simulate op lets you test the trigger without waiting for a real event to occur. The full event payload is emitted downstream at the event output port.

Guide

Fire a flow when internal platform events occur

What It Does

Platform Trigger is an IO element that listens for internal Triform platform events and fires connected flows when they occur. Unlike external IO connectors, it reacts to events within the platform itself — element creation, state changes, operation executions, or custom events published by other elements.

Element Definition

PropertyValue
Typeplatform-trigger
Categoryio
Formatom

Key Properties

FieldTypeDefaultDescription
event_typesarrayPlatform event types to listen for
source_filterobjectFilter by source element type, circle, or ID
debounce_msinteger0Debounce interval to coalesce rapid events

Usage

  1. Configure which platform event types to listen for
  2. Optionally filter by source element type or circle
  3. Wire to an automation or action to react to platform events

Capabilities

  • event-matching: Glob-pattern platform event matching
  • cel-filtering: CEL expression filtering on event payloads
  • concurrency-control: Bounded concurrent flow invocations

Properties

PropertyTypeDefaultDescription
eventsarrayPlatform event patterns to watch (e.g., ‘element.created’, ‘run.completed’, ‘element.*’)
element_type_filterstringOnly fire for events on this element type (e.g., ‘automation’, ‘python’)
filterstringCEL expression evaluated against the event payload — fires only when true
max_concurrencyinteger5Maximum concurrent flow invocations from this trigger
trigger_onstringEvent type to trigger on (e.g., ‘element_change’, ‘run_completed’). Alias for events — sets a single event pattern.
target_refstringSlug or path of the element to invoke when the trigger fires
target_operationstring"invoke"Operation to dispatch on the target element when the trigger fires
target_elementstringSlug or path of the element to watch for events
descriptionstringHuman-readable description of what this trigger does
enabledbooleantrueWhether this trigger is active

Operations

activity

Get /ops/activity | Auth: Read

Get activity events for this element

Scope depends on element capabilities: individual elements query by element_id, project-form elements with activity-scope-members include member activities, circle-level elements with activity-scope-all query the entire circle. Gracefully returns empty list if activities table is missing (old circles).

attachments

Get /ops/attachments | Auth: Read

List all modifiers and resources attached to this element

Returns both modifiers (policy enforcement) and resources (data injection) with is_modifier flag to distinguish. Items in the generated MODIFIER_TYPES list are modifiers; everything else is a resource. Includes cascade_policy and version pin info.

batch_stats

Get /ops/batch_stats | Auth: Read

Get per-element statistics for all children of this element

Returns per-child stats plus an aggregate. Most meaningful on compound or manifest form elements (repositories, circles, projects); atoms have no children so the result is an empty children array with a zeroed aggregate. Uses efficient GROUP BY SQL. Weighted averages for eval scores.

compose

Post /ops/compose | Auth: Execute

Batch add and remove modifiers on this element in a single call

Declarative composition: add modifiers by ref path (slug or path@version) and remove by attachment ID, all in one atomic call on the target element. Each ‘add’ entry resolves the source element, validates topology, attaches with optional priority and cascade policy. Each ‘remove’ entry deletes the attachment row. Returns a summary of what was added and removed. Example: compose({ add: [{ref: “my-prompt”}, {ref: “rate-limit/api@v2”, priority: 50}], remove: [{attachment_id: “uuid”}] })

context

Get /ops/context | Auth: Read

Get connected elements (graph traversal)

Graph traversal showing all connected elements with their relationship type (contains, contained_by, references, referenced_by, attaches, etc.). Use ?depth=N to control traversal depth (default 1) and ?types=actor,data to filter by element types.

create

Post /ops/create | Auth: Write

Create child element

POST to the parent path — element_type goes in the request body, NOT the URL. Both element_type and slug are required and must be non-empty. Name is derived from slug if omitted. Writes to both Git and PostgreSQL. All elements are stored flat under the circle — no intermediate library wrapper rows.

delete

Delete /ops/delete | Auth: Admin

Delete element (soft delete)

Soft delete — sets state to ‘deleted’ but retains the record. Cannot delete elements that have children (has_no_bond precondition) or active runs. Requires admin auth and confirmation.

deprovision

Post /ops/deprovision | Auth: Execute

Deactivate the platform trigger (stop watching for events)

Removes this trigger from the platform event watcher. No further events will fire the connected flow until re-provisioned.

disable

Post /ops/disable | Auth: Admin

Disable element (hides and prevents use)

Idempotent — safe to call on already-disabled elements. Optionally pass a reason string. Disabled elements cannot be invoked or executed. Inverse of enable.

enable

Post /ops/enable | Auth: Admin

Enable element (makes usable and visible)

Idempotent — safe to call on already-enabled elements. Transitions element to ready/enabled state. Cannot enable deleted elements. Inverse of disable.

export_bundle

Get /ops/export/bundle | Auth: Read

Export element as downloadable git bundle

On non-root-namespace elements, returns a binary git bundle. On root-namespace (circle) elements, dispatch hands off to the circle’s own export_bundle op, which returns a multi-element JSON envelope with one base64 bundle per child element — this is intentional, not an error.

get

Get /ops/get | Auth: Read

Get element details

Element is already resolved by the routing layer — this returns the cached element, not a fresh DB query. Use the path /api/{circle}/{slug} to address elements.

history

Get /ops/runs | Auth: Read

List past trigger invocations

Lists recent trigger invocations with their event name, timestamp, and outcome (completed, failed, skipped). Use to audit trigger reliability and diagnose missed events.

import_bundle

Post /ops/import/bundle | Auth: Write

Import git bundle into element

Accepts a base64-encoded git bundle in the JSON bundle_base64 field. Use overwrite=true to replace existing elements with same slug (default skips duplicates). Imported elements get new UUIDs. Returns counts of imported/skipped elements and any errors.

intention

Get /ops/intention | Auth: Read

Get element intention with full inheritance chain

Returns three levels: direct (this element’s intention), inherited (from category and root), and resolved (final merged intention). Useful for understanding an element’s purpose in context of its hierarchy.

promote

Post /ops/promote | Auth: Admin

Promote element configuration to a target environment

Only for manifest-form elements (projects). Environments advance: dev → demo → live. dev→demo requires member+ role, demo→live requires admin. Freezes member versions at promotion time (creates snapshot). Persists environment config to spec.environments.

provision

Post /ops/provision | Auth: Execute

Activate the platform trigger (begin watching for events)

Registers this trigger with the platform event watcher. After provisioning, matching platform events will automatically fire the connected flow. Returns the list of subscribed event patterns.

readme

Get /ops/readme | Auth: Read

Get element README.md content

Reads README.md from the element’s git repository. Returns empty content (not an error) if no README exists. Always returns markdown format.

readme_update

Post /ops/readme_update | Auth: Write

Update element README.md content

Creates or overwrites README.md in the element’s git repo. Commits to the draft branch. Content must be provided as a markdown string.

receive

Post /ops/receive | Auth: None

Receive incoming external traffic

Entry point for external traffic reaching this IO element. Declared auth: none to bypass platform auth — element-level auth is enforced by IoReceiveExecutor before dispatching into the flow graph. The flow/app that wires this element as an entry point determines what happens next.

remove-modifier

Post /ops/remove-modifier | Auth: Execute

Remove an attached modifier from this element by attachment ID

Removes a modifier/resource attachment by its row ID. The ID comes from the attachments or context API. This is the reverse of attach — called on the target element, not the source.

restore

Post /ops/restore | Auth: Admin

Restore element to a specific version

Automatically snapshots the current state before restoring (creates a ‘Before restore to vN’ version entry). Writes restored spec to git as .triform/spec.yaml. Git failures warn but don’t fail the operation — DB state is authoritative. Cannot restore deleted elements.

schema

Get /ops/schema | Auth: Read

Get element input/output schema (MCP tools/list compatible)

Returns type-level port schemas from the TypeRegistry — not instance-specific overrides. Includes direction (input/output), required flag, and JSON schema per port. Useful for understanding what data an element accepts and produces.

send

Post /ops/send | Auth: Execute

Send a message/request to external system

Explicitly sends payload to the configured external target. For HTTP elements, POSTs to the target URL. For chat platforms, sends via the platform API. Put data in the payload field. Returns send status and response details.

simulate

Post /ops/simulate | Auth: Execute

Simulate a platform event to verify the trigger fires correctly

Builds a synthetic event with the provided event_name and payload, evaluates the CEL filter and element_type_filter, and emits the event to the connected flow synchronously. Returns the flow’s response. Does not require the trigger to be provisioned and does not count toward max_concurrency. target_ref is optional in the request body and falls back to spec.target_ref. If the trigger has no event patterns (no spec.events and no spec.trigger_on) and no target_ref in either spec or body, simulate returns 200 with matched:false and a reason (for example, “target_ref is required” or “At least one event pattern is required”) rather than a 400 — an unconfigured trigger is a valid matched:false outcome, not a validation error.

source

Get /ops/source | Auth: Read

Get any file’s content from the element’s git repository

Reads an arbitrary file from the element’s CAS-backed git tree by its relative path. Same store as readme, just generalized. Path safety: rejects .. traversal, leading /, and null bytes. Use this to view main.py for action elements, asset files for SPAs, etc. Returns empty content (not an error) if the file doesn’t exist.

source_branches

Get /ops/source/branches | Auth: Read

List Source branches for this element

Returns the standard draft/demo/live Source branches, their current commits, and promotion relationships. Use GET /api/{element_path}/ops/source/branches.

source_promote

Post /ops/source/promote | Auth: Write

Promote Source branch forward

Promotes draft to demo or demo to live through the generated element op path. Direct Git pushes to demo/live are blocked by Source policy.

source_repair

Post /ops/source/repair | Auth: Write

Inspect or repair the element Source index

Runs Source repair through the element operation path. Defaults to dry_run=true; set dry_run=false only after reviewing a dry-run report.

source_status

Get /ops/source/status | Auth: Read

Get Source control status for this element

Returns the branch-aware clone URL, checkout commands, current draft commit, child source-link count, portable export summary, Source health, warnings, and auth hints for the addressed element. Use the element-first path: GET /api/{element_path}/ops/source/status.

source_validate

Post /ops/source/validate | Auth: Read

Validate Source branch contents

Validates a Source branch before accepting local Git workflow changes or promotion. Defaults to branch=draft and rejects runtime data, generated output, secret material, and unreadable CAS refs.

stats

Get /ops/stats | Auth: Read

Get aggregate statistics for this element

Health status is computed: error if errors_per_day > 5 or success_rate < 0.8, warning if errors_per_day > 0 or success_rate < 0.95. Firing alerts escalate health to error/warning. Default period is ‘day’. Returns runs_per_day, success_rate, avg_duration_ms, and more.

test_connection

Post /ops/test-connection | Auth: Execute

Test connection configuration

Validates the element’s configuration locally without making an actual external connection. Checks that required credentials are set, URLs are valid, etc. Returns success boolean and error details. Safe to call repeatedly.

tree

Get /ops/tree | Auth: Read

Get the element’s position in the graph — ancestors, children, references, and subtree statistics

Uses per-circle ElementGraph cache for O(1) lookups. Returns ancestors (containment chain), children (direct), members (references), referenced_by (reverse refs), attachments, and subtree stats. Default depth is 3, max is 10. Pass ?include_metadata=true for name/state on each node.

update

Patch /ops/update | Auth: Write

Update element

Partial update — send only the fields you want to change. spec, name, and intention are all independently optional. spec MUST be a JSON object when present; deep-merged into the existing spec by default. Empty {"spec":{}} preserves existing spec content but still records a new version (no-op for content, not for version state). To clear/replace the entire spec wholesale send {"spec":{...},"deep":false}. List-typed spec fields use replace semantics (the patch list replaces the existing list, no array merging). Coordinates Git + DB writes. Slug cannot be changed after creation.

update_meta

Patch /ops/update_meta | Auth: Write

Update element metadata (lightweight merge — does NOT bump version or snapshot spec)

Shallow JSONB merge into element.meta. Top-level keys in the provided value replace existing meta values; other keys are preserved. Used for UI metadata like canvas positions, panel state, viewer preferences. Wire-shape op_name is update_meta (distinct from update) so SSE subscribers + the cache auto-invalidator can distinguish lightweight metadata changes from spec edits without inspecting the payload. The MutatingElementStore wrapper stamps this op_name on the lifecycle event emitted by update_element_meta storage calls.

version

Get /ops/version | Auth: Read

Get current version or full history

Returns current version by default. Pass ?history=true for full version history (up to ?limit=N, default 50). Versions are backed by the element_versions table. Every spec update creates a new version entry.

Error Codes

CodeClassRetryableDescription
TRIGGER_FILTER_INVALIDvalidationnoCEL filter expression is invalid or failed to compile
TRIGGER_CONCURRENCY_EXCEEDEDlimityesMaximum concurrent invocations reached — event dropped

Lifecycle / runtime

Inherited from io

Before request

  • validate_auth
  • check_rate_limit

After request

  • record_metrics

On error

  • log_error
  • retry_if_transient

Execution model: async

Observability

Defined for this element

Metrics

  • event_received_count
  • event_matched_count
  • event_filtered_count
  • filter_evaluation_duration_ms
  • fire_count
  • fire_duration_ms
  • concurrency_rejected_count
  • simulate_count

Events

  • trigger.event.received
  • trigger.event.matched
  • trigger.event.filtered
  • trigger.fired
  • trigger.completed
  • trigger.failed
  • trigger.concurrency_exceeded
  • trigger.provisioned
  • trigger.deprovisioned
  • trigger.simulated

Pricing / cost

Platform default

Operation costs

  • create: free
  • update: free
  • delete: free
  • get: free
  • list: free
  • invoke: 10000 micro-AU
  • tool_use: free

Set it up

Eventsstring
Platform events to listen for