{"record":{"id":"d0656c6597218d47","repo":"ComposioHQ/composio","slug":"trigger-type-slug-not-found","errorCode":null,"errorMessage":"Trigger type ${slug} not found","messagePattern":"Trigger type (.+?) not found","errorType":"exception","errorClass":"ComposioTriggerTypeNotFoundError","httpStatus":null,"severity":"error","filePath":"ts/packages/core/src/models/Triggers.ts","lineNumber":350,"sourceCode":"      throw new ValidationError(`A non-empty userId is required to create a trigger`);\n    }\n\n    const parsedBody = TriggerInstanceUpsertParamsSchema.safeParse(body ?? {});\n\n    if (!parsedBody.success) {\n      throw new ValidationError(`Invalid parameters passed to create trigger`, {\n        cause: parsedBody.error,\n      });\n    }\n\n    // Validate the trigger slug up-front so callers get a clear client-side\n    // `ComposioTriggerTypeNotFoundError`. The Python SDK mirrors this behavior.\n    try {\n      await this.getType(slug, requestOptions);\n    } catch (error) {\n      // The trigger types endpoint returns 400 (not 404) for an unknown slug.\n      if (error instanceof APIError && (error.status === 400 || error.status === 404)) {\n        throw new ComposioTriggerTypeNotFoundError(`Trigger type ${slug} not found`, {\n          cause: error,\n          possibleFixes: [\n            `Please check the trigger slug`,\n            `Please check the provided version of toolkit has the trigger`,\n            `Visit the toolkit page to see the available triggers`,\n          ],\n        });\n      }\n      throw error;\n    }\n\n    // Pass `user_id` straight through: when `connected_account_id` is omitted the\n    // backend resolves the first active connection for this user and the\n    // trigger's toolkit, mirroring tool execution. When 2FA is enabled and\n    // `connected_account_id` is pinned, the backend validates that `user_id`\n    // owns it.\n    const upsertParams: ClientTriggerInstanceUpsertParams = {\n      connected_account_id: parsedBody.data.connectedAccountId,","sourceCodeStart":332,"sourceCodeEnd":368,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/core/src/models/Triggers.ts#L332-L368","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the slug against triggers.listTriggerTypes() (or the toolkit's trigger list) and correct it","If the trigger existed before, check whether it was renamed/removed in your pinned toolkit version — use the new name or bump the version","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"],"exampleFix":"// before\nawait triggers.create(userId, 'github_issue_open', { triggerConfig: {...} });\n\n// after\nconst types = await triggers.listTriggerTypes();\nconst slug = types.find(t => t.slug.includes('issue'))?.slug!;\nawait triggers.create(userId, slug, { triggerConfig: {...} });","handlingStrategy":"try-catch","validationCode":"const known = await triggers.listTriggerTypes();\nconst slugs = new Set(known.map(t => t.slug));\nif (!slugs.has(desiredSlug)) throw new Error(`Unknown trigger slug: ${desiredSlug}`);","typeGuard":"// with a cached slug set from listTriggerTypes():\nconst isValidTriggerSlug = (slug: string): boolean => cachedTriggerSlugs.has(slug);","tryCatchPattern":"try {\n  await triggers.create(userId, slug, body);\n} catch (e) {\n  if (e instanceof ComposioTriggerTypeNotFoundError) {\n    // use e.possibleFixes / listTriggerTypes to correct the slug and retry\n  }\n}","preventionTips":["Cache valid trigger slugs and validate LLM-provided slugs before create","Watch toolkit changelogs for renamed triggers when bumping versions","Distinguish this from generic ValidationError in trigger flows — it means the slug itself is wrong"],"tags":["composio","triggers","not-found","slug","typescript"],"backgroundTag":"resource-not-found","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}