New to Kestra?
Use blueprints to kickstart your first workflows.
Read Freshdesk tickets on a schedule, change nothing, and alert Slack when open tickets pass their due time, paging for High and Urgent ones.
Freshdesk sets a resolution due time and a first-response due time on every ticket from its SLA policies, but a breach only shows up in a view someone has to open. By the time a manager notices, an urgent customer has already waited too long. This blueprint turns a scheduled, read-only call to the Freshdesk Tickets API into an SLA gate: io.kestra.plugin.core.http.Request reads recent tickets, one jq query counts open tickets past their due time and first responses that were escalated, and the result routes to a quiet log, a Slack note, or a Slack page for High and Urgent tickets.
list_tickets (io.kestra.plugin.core.http.Request) calls GET /api/v2/tickets with updated_since set to the lookback window, per_page=100 and order_by=due_by ascending, using HTTP basic auth with the API key as the username and X as the password, as Freshdesk documents. It is a read: no ticket is changed. Retries cover short network blips, and allowFailed plus allowFailure keep an API error from aborting the flow so it can be reported instead.summarize_sla (io.kestra.plugin.core.debug.Return) first guards for a missing or non-200 response (UNREACHABLE). Otherwise one jq query keeps tickets in status 2 (Open) or 3 (Pending), counts those whose due_by is earlier than now (UTC) and those with fr_escalated set, counts how many breached tickets have priority 3 (High) or 4 (Urgent), and names the oldest breach. Any High or Urgent breach is CRITICAL, any other breach is WARNING, otherwise HEALTHY.route_by_sla_state (io.kestra.plugin.core.flow.Switch) branches on that classification: HEALTHY logs quietly, WARNING posts a Slack note, CRITICAL and UNREACHABLE page Slack. A defaults fallback logs anything unexpected.log_audit_result (io.kestra.plugin.core.log.Log) writes one audit line per run with the HTTP status and the full summary.errors block pages Slack if the flow itself fails, so a broken sentinel is never mistaken for a healthy queue.sla_check trigger runs every 30 minutes from 09:00 to 19:00 IST, Monday to Saturday, and ships disabled: true.status output (HEALTHY / WARNING / CRITICAL / UNREACHABLE) other flows can gate on.Freshdesk's SLA reminders are per ticket and per agent. Kestra turns a plain, read-only API call into a scheduled, typed classification across the whole queue, with retries, a failure path and an execution history, and the Switch branch is ready to grow into real actions (reassigning a group, opening an incident) without rewriting the check.
due_by and fr_due_by.FRESHDESK_DOMAIN: the subdomain only, for example acme for acme.freshdesk.com.FRESHDESK_API_KEY: the agent API key.SLACK_WEBHOOK: Slack incoming webhook used for every alert branch and the flow-failure alert.In Kestra OSS, secrets are supplied as environment variables prefixed SECRET_ and base64-encoded, for example SECRET_FRESHDESK_DOMAIN=$(echo -n 'acme' | base64), and read back with {{ secret('FRESHDESK_DOMAIN') }}. Use the Enterprise secrets backend for encryption at rest and access control.
FRESHDESK_DOMAIN, FRESHDESK_API_KEY and SLACK_WEBHOOK as secrets.status should be CRITICAL.sla_check.page parameter.group_id with the Filter Tickets API to run one sentinel per support team.lookback_days: type INT, default 30.status: one of HEALTHY, WARNING, CRITICAL, UNREACHABLE.{{ fromJson(outputs.summarize_sla.value).oldest_breach }} for the oldest breached ticket.per_page is capped at 100. Tickets are sorted by due_by ascending, so the most overdue ones come first, but a queue with more than 100 recently updated tickets needs paging to see all of them.lookback_days is not returned; keep the window at least as long as your longest SLA.due_by is compared with the current time in UTC; Freshdesk returns timestamps in UTC, so time zones do not shift the result.