Golem trigger agent effect

From golemcloud/golem · View interactive version

Golem trigger agent effect is an AI agent skill from the GitHub repository golemcloud/golem. Triggering a fire-and-forget CLI invocation on an Effect-based Golem agent. Use when asked to trigger, enqueue, or invoke an agent method without waiting using golem agent invoke --trigger.

How to use this skill

Skill file

Triggering a Fire-and-Forget Effect Agent Invocation

Both golem and golem-cli can be used — all commands below work with either binary. Effect

agents use the ordinary Golem CLI; do not replace a requested shell operation with an in-agent

typed-client call.

Usage

golem agent invoke --trigger <AGENT_ID> <FUNCTION_NAME> [ARGUMENTS...]

The --trigger (or -t) flag submits the invocation and returns after Golem accepts it. The

target method executes asynchronously; the command does not wait for its result or prove that its

side effects are already visible.

Use trigger mode when the caller does not need the return value, such as for background work,

long-running operations, fan-out, or notifications. Use regular golem agent invoke when the

caller needs the method result or must know that the invocation finished.

Effect Agent Names and Arguments

For an agent declared with defineAgent and method:

Do not infer the runtime name from an exported TypeScript binding or translate method names to

snake_case. The generated Effect starter declares its counter with the exact runtime name

CounterAgent:

export const CounterAgent = defineAgent({
  name: "CounterAgent",
  id: { name: Schema.String },
  methods: {
    increment: method({
      input: {},
      success: Schema.Number,
    }),
  },
});

Trigger that starter agent as CounterAgent("c1"):

golem agent invoke --trigger 'CounterAgent("c1")' increment

Pass one native TypeScript literal per user-supplied input field in declaration order. Skip host-injected Principal fields; do not supply a principal value or placeholder. Do not wrap them in the named input

objects used by the Effect SDK client. For example, a method declared with

input: { amount: Schema.Number } receives 5 from the CLI, not { amount: 5 }. If a declared

parameter is itself a record, pass that record value as one shell argument.

No-input methods take no arguments, not '{}'. --format json selects output formatting,

not input encoding. Awaited, triggered, and scheduled invocations share the same CLI argument parser.

Load golem-invoke-agent-effect for the string fallback and the different HTTP named-body rules.

Examples

Trigger a method with an argument

golem agent invoke --trigger 'MyAgent()' startBackgroundJob '"job-123"'

Trigger in a specific environment

golem agent invoke --trigger \
  'staging/MyAgent("user-123")' sendNotification '"Your order is ready"'

Trigger with an explicit idempotency key

golem agent invoke --trigger -i 'job-run-2026-07-19' \
  'BatchProcessor()' runDailyReport

Result and Idempotency

A triggered invocation returns its effective idempotency key, not the method's success value.

Golem generates a key when none is supplied. Reusing an explicit key when retrying the command

prevents that invocation from executing more than once.

Do not invoke the method again merely to verify that trigger mode returned: a second invocation

changes state independently. When verification is required, wait or poll through a separate

read-only method whose contract exposes the relevant state.

Available Options

| Option | Description |

| ----------------------------- | -------------------------------------------------------------- |

| -t, --trigger | Trigger without waiting for the method result |

| -i, --idempotency-key <KEY> | Set an idempotency key; use "-" for an auto-generated key |

| --no-stream | Disable live streaming of agent stdout, stderr, and logs |

| --schedule-at <DATETIME> | Schedule for an ISO 8601 / RFC 3339 time; requires --trigger |

If the component is not deployed and the command runs from its application directory, the CLI

can automatically build and deploy it before submitting the invocation.

Effect CLI Value Syntax

Effect components report TypeScript as their source language, so constructor values in agent keys and method

arguments use TypeScript syntax even though contracts are declared with Effect Schema:

Quote each structured value as one shell argument. String values need TypeScript string quotes

inside the shell quotes:

This example assumes input: { request: Schema.Struct({ to: Schema.String, subject: Schema.String, body: Schema.String }) }.

The unquoted fields belong to the single request value, not to the input map:

golem agent invoke --trigger 'MyAgent("user-123")' sendEmail \
  '{ to: "alice@example.com", subject: "Hello", body: "World" }'

CLI Triggering vs Effect SDK Triggering

This skill covers invocation from a shell. Inside Effect agent code, a typed remote method instead

provides remote.method.trigger(input), for example remote.increment.trigger({}). That returns a

lazy Effect and must be executed by composing or yielding it. It is not an alternative CLI

syntax for golem agent invoke --trigger.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.