Skip to main content

Zapier

Invoke Zihin agents from Zapier with the Invoke Agent action. It calls a hosted agent (over @zihin/agent-client) and returns the result for use in later Zap steps.

Private integration (invite only)

The Zihin Zapier app (version 0.2.0, over @zihin/agent-client 0.7.0) is available as a private integration: it is not listed in the Zapier app directory yet. Accept the invite to add it to your Zapier account:

Join the Zihin integration on Zapier

Connect your account​

FieldDescription
API Keyzhn_live_* / zhn_test_* from Settings → API Keys (the tenant is embedded).
Base URLDefaults to https://llm.zihin.ai. Override only for a private deployment.
Allow custom base URLOff by default. Enable only to target a base URL outside the Zihin domain whitelist — your key is sent there.
Allow HTTP / localhostDevelopment only.

The connection is tested by listing your agents.

Action: Invoke Agent​

FieldDescription
AgentThe agent to invoke — populated from your tenant (dynamic dropdown).
MessageThe input sent to the agent.
Session IDReuse to continue a conversation; the output returns the session ID.
Temperature / Max Tokens (no effect)Deprecated: the agent uses its own temperature and output limit (configure them on the agent). Kept so saved Zaps keep loading; not sent.
Client Message ID (Idempotency)Optional UUID that makes retries safe. See below.
Timeout (ms)Max total time for the agent turn. Set it to 25000 or less (see the step time limit below). Timeout only shortens the turn deadline. See Agent invocation contract.
Include Raw EventsInclude the raw SSE events in the output (debugging).

Output fields (mappable in later steps): content, contentSource, sessionId, model, usage (total tokens, cost), iterations, executionTimeMs, outcome, truncated, finishReason, executionId, clientMessageId, idempotentReplay, gated.

  • clientMessageId echoes the Client Message ID input; idempotentReplay is true when the backend replayed the stored answer of an earlier call with the same ID.

Client Message ID (Idempotency)​

Zapier re-runs steps on errors. With a Client Message ID, a retry never runs the agent twice: sending the same UUID with the same message while the first run is still in flight returns a retryable session busy error; once it finished, the stored answer is replayed (idempotentReplay: true).

Use a new UUID per message, never a fixed value — a fixed UUID with a fixed message would return the same stored answer for 24 hours. Map it from a unique ID of the triggering record when it is a UUID. It is best effort: only a finished turn is protected (a turn that was cut off, timed out or failed runs again), and the backend skips the check if its cache is unavailable. It requires a Zihin backend from October 2026 or later; otherwise the step fails instead of silently running without the guarantee. See the contract.

Step time limit

Zapier caps each step at ~30 seconds. The action is best for agents that respond quickly: set Timeout (ms) to 25000 or less so the agent ends the turn itself and the Zap gets a clear timeout error instead of a cut-off step. Agents that need longer runs are not a fit for a single Zapier step.

Error handling​

Failures are mapped to native Zapier errors: an authentication problem prompts a reconnect, a rate limit or a transient block (such as SESSION_BUSY, another turn still running in the session) triggers Zapier's hold-and-retry, and other failures surface a clear message — never leaking your API key.

Example​

[Trigger] → [Zihin · Invoke Agent] → [Action with {{content}}]
  1. Create a Zihin connection (above).
  2. Add Zihin → Invoke Agent, pick the Agent, and map the Message.
  3. Use the content output in the next step; store sessionId to continue the conversation.

What changed in 0.2.0​

  • Steps that used to succeed can now fail. A turn the model provider refused under its content policy (REFUSED), or that hit the context limit (CONTEXT_LIMIT), now fails the step with a clear error instead of returning the platform's neutral sentence as the answer.
  • "Session busy" (another turn still running) is now a retryable error.
  • New optional input Client Message ID (Idempotency); output gains idempotentReplay.