Torq

Torq

Certified
Enterprise Edition

Torq plugin for Kestra

Query and update Torq cases, trigger flows on new or updated cases, list workflows, run them through their webhook triggers and follow their executions.

How to use the Torq plugin

This plugin lets Kestra flows read and update cases in Torq, run Torq workflows through their webhook triggers, and react to new or updated cases. It uses the Torq public API.

Authentication

Every task and trigger except workflows.Execute authenticates with a Torq API key (OAuth2 client credentials):

  • clientId (required, secret) — client ID of the API key.
  • clientSecret (required, secret) — client secret of the API key.
  • region (optional) — US (default), EU or JP; selects the API and authentication hosts. API keys are scoped to a single workspace, and a region that does not match it returns 401.
  • apiUrl / authUrl (optional, advanced) — override the hosts derived from region; apiUrl includes the /public prefix.
  • options (optional, advanced) — HTTP client timeouts, proxy and SSL settings.

Store the credentials as Kestra secrets and set them with plugin defaults to avoid repeating them. A one-hour bearer token is acquired once per task run or trigger poll and never cached across executions. The Torq API is v1alpha, so response models ignore unknown fields.

Tasks

Cases (io.kestra.plugin.ee.torq.cases)

  • Query — searches cases by states, severities, assignees, text and tags (plus a raw filters escape hatch), sorted with orderBy / order. Follows next_page_token up to maxResults; fetchType is FETCH, FETCH_ONE, STORE or NONE. Use STORE for large result sets.
  • Get — reads a case by its numeric caseId.
  • Update — updates the properties that are set (title, caseDescription, state, severity, assignee, category, tags, customFields) and outputs the case read back. tags are added to the existing tags, never replacing them, and each customFields entry is written with its own call.
  • AddComment — adds a timeline comment, INTERNAL by default or PUBLIC.

caseId is a string so it can be templated from upstream outputs, but it must be the numeric case id (for example 28, not the display id #28). states is free text because workspaces can define custom states; severities accept INFORMATIONAL, LOW, MEDIUM, HIGH, CRITICAL in any case.

Workflows (io.kestra.plugin.ee.torq.workflows)

  • List — lists workflows, filtered by name and tags.
  • Get — reads a workflow by workflowId.
  • GetExecution — reads the status and output of an execution. It does not fail when the execution failed.
  • Execute — posts payload to a workflow's webhook trigger URL.

Execute sends no bearer token to the webhook: the URL embeds the integration secret, so webhookUrl is a secret and is never logged or included in errors. Torq URL variants behave differently:

  • Async URL — answers with the execution id.
  • Sync URL — answers with the workflow output when it finishes within about 50 seconds (returned as output), and with 201 plus the execution id otherwise. A failed sync run is answered with HTTP 200; the task detects it and fails with the Torq message.
  • Generic Webhook URL — fans out to several workflows and returns no execution id, so nothing can be awaited.

With wait: true the task polls the execution every pollInterval until a terminal status or waitTimeout, and fails unless the status is SUCCESS. This needs clientId and clientSecret, checked before the workflow is fired. Killing the Kestra task only stops the polling: Torq has no public API to cancel a run.

Triggers

  • cases.Trigger — polls cases/query and starts one execution with every case created or updated since the last delivery (onlyNew: true tracks creation only), oldest first, at most maxResults per poll. It accepts the same filters as cases.Query. Outputs: cases and count.

The watermark (newest delivered timestamp plus the ids delivered at that instant) lives in the namespace KV store and advances on every poll that delivers cases, so a case is never delivered twice and a truncated poll never skips cases. The first poll only records a baseline at the newest case of the workspace, ignoring the filters; it does not replay the case history.