ComposioHQ/composio · error · ValidationError

Invalid parameters passed to list triggers

Error message

Invalid parameters passed to list triggers

What it means

ValidationError('Invalid parameters passed to list triggers') is thrown by Triggers.listActive when the query fails TriggerInstanceListActiveParamsSchema.safeParse(query ?? {}). Because {} is validated when query is omitted, this only fires on malformed provided filters — wrong element types, unknown keys, or invalid values. ZodError is attached as cause.

Source

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

   *
   * @example
   * ```ts
   * const triggers = await triggers.listActive({
   *   authConfigIds: ['123'],
   *   connectedAccountIds: ['456'],
   * });
   * ```
   */
  async listActive(
    query?: TriggerInstanceListActiveParams,
    requestOptions?: ComposioRequestOptions
  ): Promise<TriggerInstanceListActiveResponse> {
    // Validate the parameters if provided

    const parsedParams = TriggerInstanceListActiveParamsSchema.safeParse(query ?? {});

    if (!parsedParams.success) {
      throw new ValidationError(`Invalid parameters passed to list triggers`, {
        cause: parsedParams.error,
      });
    }

    const listParams = query
      ? {
          auth_config_ids: parsedParams.data.authConfigIds,
          connected_account_ids: parsedParams.data.connectedAccountIds,
          cursor: parsedParams.data.cursor,
          limit: parsedParams.data.limit,
          show_disabled: parsedParams.data.showDisabled,
          trigger_ids: parsedParams.data.triggerIds,
          trigger_names: parsedParams.data.triggerNames,
        }
      : undefined;
    const result = await withCancellation(
      () => this.client.triggerInstances.listActive(listParams, requestOptions),
      requestOptions?.signal

View on GitHub (pinned to 64b1b85502)

Solutions

  1. Inspect error.cause ZodError issues and correct the named fields
  2. Wrap scalar values in arrays where the schema expects arrays (triggerSlugs: [slug])
  3. Use camelCase parameter names matching the SDK schema, not raw API snake_case

Example fix

// before
await triggers.listActive({ triggerSlugs: 'github_issue_opened' });

// after
await triggers.listActive({ triggerSlugs: ['github_issue_opened'] });
Defensive patterns

Strategy: validation

Validate before calling

import { TriggerInstanceListActiveParamsSchema } from '@composio/core';
const ok = TriggerInstanceListActiveParamsSchema.safeParse(query ?? {});
if (!ok.success) {
  throw new Error(ok.error.issues.map(i => `${i.path}: ${i.message}`).join('; '));
}

Type guard

const isStringArray = (v: unknown): v is string[] =>
  Array.isArray(v) && v.every(x => typeof x === 'string');

Try / catch

try {
  await triggers.listActive(query);
} catch (e) {
  if (e instanceof ValidationError) console.error(e.cause?.issues);
}

Prevention

When it happens

Trigger: Calling triggers.listActive(query) with filters violating the schema — e.g. triggerSlugs/toolkits/userIds containing non-strings, a scalar where an array is expected, snake_case keys, or invalid pagination values.

Common situations: Passing triggerSlugs: 'github_issue_opened' instead of an array; copying raw API query param names; passing numbers where strings are required after an SDK upgrade.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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