Skip to content

Reference

lg_agents_add_trigger: Add a trigger

Markdown version

Add a trigger to an agent: a schedule (cron), an event or a webhook.

  • Changes data: yes
  • Credential scope: agents:write (an API key's scopes, or what you allowed when connecting with OAuth)
  • Assistant level: an assistant at Full; a lower level is refused

Inputs

FieldTypeRequiredNotes
idstringyes
bodyobject (type, name, enabled, cron, timezone, event, conditions, input, dedupe, max_concurrent, skill, dedupe_window_minutes)yes
body.type"schedule" | "event" | "webhook"yes
body.namestringno
body.enabledbooleanno
body.cronstringnoSchedules: 5-field cron, read in timezone
body.timezonestringnoIANA time zone, default UTC
body.eventstringnoEvents: run.finished, approval.needed, connection.created, connection.failed
body.conditionsobjectno{ all: [...], any: [...] } of { path, op, value } over event.* and record.*
body.inputobjectnoRun input: literals or { "$ref": "event.record_id" } / body.* / record.values.*
body.dedupestring or nullnoA path whose value makes two firings the same (e.g. event.record_id)
body.max_concurrentintegerno
body.skillstring or nullnoA skill slot of the agent this trigger runs (its instructions lead the run)
body.dedupe_window_minutesintegernoHow long a dedupe key holds (default 24 h)

Example MCP call

A tools/call request to https://manage.restolayer.com/mcp:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "lg_agents_add_trigger",
    "arguments": {
      "id": "agt_01HZXEXAMPLE",
      "body": {
        "type": "schedule",
        "cron": "0 8 * * 1",
        "timezone": "America/New_York"
      }
    }
  }
}

Example REST call

The same thing over REST (POST /v1/agents/:id/triggers):

curl -s -X POST "https://manage.restolayer.com/v1/agents/agt_01HZXEXAMPLE/triggers" \
  -H "Authorization: Bearer $LG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type":"schedule","cron":"0 8 * * 1","timezone":"America/New_York"}'

All tools: MCP tools. Connecting: connect your assistant.

Send feedback

Tell us what's broken, confusing or missing on this page, or an idea. It goes to the team that builds the product.
Please don't include passwords or card numbers.
Only to reply about this. Never added to any mailing list.