ComposioHQ/composio · error · ComposioTriggerTypeNotFoundError

Trigger type ${slug} not found

Error message

Trigger type ${slug} not found

What it means

ComposioTriggerTypeNotFoundError ('Trigger type ${slug} not found') is thrown by Triggers.create from its up-front getType(slug) pre-flight. The trigger types endpoint returns 400 (not 404) for unknown slugs, so any APIError with status 400 or 404 from that lookup is converted into this clear client-side error, with the original APIError as cause and possibleFixes suggesting slug/version checks. The Python SDK mirrors this behavior.

Source

Thrown at ts/packages/core/src/models/Triggers.ts:350

      throw new ValidationError(`A non-empty userId is required to create a trigger`);
    }

    const parsedBody = TriggerInstanceUpsertParamsSchema.safeParse(body ?? {});

    if (!parsedBody.success) {
      throw new ValidationError(`Invalid parameters passed to create trigger`, {
        cause: parsedBody.error,
      });
    }

    // Validate the trigger slug up-front so callers get a clear client-side
    // `ComposioTriggerTypeNotFoundError`. The Python SDK mirrors this behavior.
    try {
      await this.getType(slug, requestOptions);
    } catch (error) {
      // The trigger types endpoint returns 400 (not 404) for an unknown slug.
      if (error instanceof APIError && (error.status === 400 || error.status === 404)) {
        throw new ComposioTriggerTypeNotFoundError(`Trigger type ${slug} not found`, {
          cause: error,
          possibleFixes: [
            `Please check the trigger slug`,
            `Please check the provided version of toolkit has the trigger`,
            `Visit the toolkit page to see the available triggers`,
          ],
        });
      }
      throw error;
    }

    // Pass `user_id` straight through: when `connected_account_id` is omitted the
    // backend resolves the first active connection for this user and the
    // trigger's toolkit, mirroring tool execution. When 2FA is enabled and
    // `connected_account_id` is pinned, the backend validates that `user_id`
    // owns it.
    const upsertParams: ClientTriggerInstanceUpsertParams = {
      connected_account_id: parsedBody.data.connectedAccountId,

View on GitHub (pinned to 64b1b85502)

Solutions

  1. Verify the slug against triggers.listTriggerTypes() (or the toolkit's trigger list) and correct it
  2. If the trigger existed before, check whether it was renamed/removed in your pinned toolkit version — use the new name or bump the version
  3. When slugs come from LLM output, validate against a cached slug set (or autocomplete step) before calling create, and handle this error with a retry using a corrected slug

Example fix

// before
await triggers.create(userId, 'github_issue_open', { triggerConfig: {...} });

// after
const types = await triggers.listTriggerTypes();
const slug = types.find(t => t.slug.includes('issue'))?.slug!;
await triggers.create(userId, slug, { triggerConfig: {...} });
Defensive patterns

Strategy: try-catch

Validate before calling

const known = await triggers.listTriggerTypes();
const slugs = new Set(known.map(t => t.slug));
if (!slugs.has(desiredSlug)) throw new Error(`Unknown trigger slug: ${desiredSlug}`);

Type guard

// with a cached slug set from listTriggerTypes():
const isValidTriggerSlug = (slug: string): boolean => cachedTriggerSlugs.has(slug);

Try / catch

try {
  await triggers.create(userId, slug, body);
} catch (e) {
  if (e instanceof ComposioTriggerTypeNotFoundError) {
    // use e.possibleFixes / listTriggerTypes to correct the slug and retry
  }
}

Prevention

When it happens

Trigger: Calling triggers.create(userId, slug, ...) where getType(slug) fails with APIError status 400 or 404 — slug is typo'd, belongs to another toolkit, or was renamed/removed in the pinned toolkit version.

Common situations: Typos like 'github_issue_open' vs 'github_issue_opened'; triggers renamed or removed in newer toolkit versions; using a slug from a different app's toolkit; free-form LLM-generated trigger slugs that don't exist.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of ComposioHQ/composio@64b1b85502 (2026-08-28). Data as JSON: /api/errors/d0656c6597218d47. Report an issue: GitHub.