Autonomous Deep Research and Competitor Market Intelligence Agent
Conduct deep web research on competitor moves, generate SWOT analyses, and escalate high-threat market shifts to Slack.
Read recent Exotel calls every hour, place no call, and alert Slack when failed calls cross your limits, with busy, no-answer and connect rate.
Indian businesses use Exotel for delivery-partner masking, order confirmation calls, sales dialers, OTP-by-voice and IVR campaigns. When the account balance runs out, an ExoPhone is blocked or flagged, a call flow is misconfigured, or a telecom route has trouble, calls end with Status: failed instead of ringing the customer, and the operations team only notices when confirmations stop coming back. Exotel records every call's outcome, but nobody watches the rate. This blueprint turns a scheduled, read-only call to the Exotel Call Details API into a calling health gate: io.kestra.plugin.core.http.Request reads recent calls, one jq query computes the failed-call rate and the connect rate, and the result routes to a quiet log or a Slack alert.
list_calls (io.kestra.plugin.core.http.Request) calls GET /v1/Accounts/{AccountSid}/Calls.json with PageSize=100, a Direction filter and a DateCreated=gte: filter for the lookback window, using HTTP basic auth with the API key and token. It is a read: no call is placed or ended. Retries cover short network blips, and allowFailed plus allowFailure keep an API error from aborting the flow so it can be reported instead.summarize_calls (io.kestra.plugin.core.debug.Return) first guards for a missing or non-200 response (UNREACHABLE). Otherwise one jq query keeps calls whose Status is final (completed, failed, busy, no-answer), ignores ones still queued, ringing or in progress, and computes the share that failed (the call could not be put through) and the share completed (the connect rate). busy and no-answer are reported but not counted as failures, because they depend on the person called. Fewer than min_calls finished calls is LOW_VOLUME; at or above critical_failure_rate is CRITICAL; at or above warning_failure_rate is WARNING; otherwise HEALTHY.route_by_failures (io.kestra.plugin.core.flow.Switch) branches on that classification: HEALTHY and LOW_VOLUME log 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, and the hourly_check trigger runs at 5 minutes past every hour (Asia/Kolkata), shipped disabled: true.status output (HEALTHY / WARNING / CRITICAL / LOW_VOLUME / UNREACHABLE) other flows can gate on, for example to pause an outbound campaign or switch order confirmations to SMS or WhatsApp while calls fail.Exotel's dashboard shows call reports and its status callbacks report one call at a time. Kestra turns a plain, read-only API call into a scheduled, typed classification with retries, a failure path and an execution history, and the status output lets your campaign and notification flows fall back to another channel automatically.
api.exotel.com or api.in.exotel.com), shown on the same page.EXOTEL_API_KEY: the API key (basic auth username).EXOTEL_API_TOKEN: the API token (basic auth password).EXOTEL_ACCOUNT_SID: the account SID used in the URL path.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_EXOTEL_API_KEY=$(echo -n 'xxxxxxxx' | base64), and read back with {{ secret('EXOTEL_API_KEY') }}. Use the Enterprise secrets backend for encryption at rest and access control.
EXOTEL_API_KEY, EXOTEL_API_TOKEN, EXOTEL_ACCOUNT_SID and SLACK_WEBHOOK as secrets, and set api_host for your cluster.min_calls and compare the counts in the logs with the call report in the Exotel dashboard.hourly_check.Metadata.NextPageUri when you place more than 100 calls in the window (the summary reports total_in_window).PhoneNumber filter to watch one ExoPhone with its own limits.connect_rate too, if a sudden drop in answered calls matters for your campaigns.api_host: type STRING, default api.exotel.com.direction: type STRING, default outbound-api.lookback_hours: type INT, default 2.warning_failure_rate: type FLOAT, default 5.0 (percent).critical_failure_rate: type FLOAT, default 15.0 (percent).min_calls: type INT, default 30.status: one of HEALTHY, WARNING, CRITICAL, LOW_VOLUME, UNREACHABLE.{{ fromJson(outputs.summarize_calls.value).connect_rate }} for the share of calls that connected.DateCreated filter is sent in IST (Asia/Kolkata); change the time zone in list_calls if your account reports in another one.busy and no-answer are normal for outbound calling and are not failures here; only failed (the call could not be put through) is.