New to Kestra?
Use blueprints to kickstart your first workflows.
Celebrate growth milestones on X automatically. An analytics webhook fires a Kestra flow that posts the milestone number and notifies Discord internally.
The dashboard crossed one hundred thousand downloads at 3 a.m. and nobody noticed until the standup. This blueprint turns the threshold crossing itself into the announcement. The analytics system POSTs the numeric value to a Kestra webhook, and io.kestra.plugin.x.XExecution interpolates the number into a reviewed customMessage line and posts the execution notification. The task is an execution notification poster, so the post always leads with the execution state and flow id, carries the milestone line, and ends with a link to the execution, a public broadcast that the milestone flow ran with the number attached. Discord receives an internal note with the exact figure that went public. Because posts on X are public and instant, the milestone line is a fixed sentence with one interpolated number rather than free-form generation, and the 280 character cap covers the full rendered post, status line and link included.
on_milestone (io.kestra.plugin.core.trigger.Webhook) exposes an endpoint guarded by a secret key. The analytics system POSTs a JSON body with the numeric value when a tracked metric crosses its threshold.post_milestone (io.kestra.plugin.x.XExecution) authenticates with the OAuth 1.0a credential set, consumer key and secret plus access token and secret, and posts the execution notification. The task renders its bundled execution template, so the post opens with the execution state and flow id, carries the customMessage milestone line, and closes with a link to the execution. The 280 character cap applies to that full rendered post, which keeps the milestone line short by design.{{ trigger.body.value ?? inputs.milestone_value }} fallback, so the same flow serves webhook-driven milestones in production and manual runs during setup.notify_internal (io.kestra.plugin.discord.DiscordIncomingWebhook) posts the figure and execution id to the team channel, so marketing knows the milestone is already public and nobody posts it twice.errors block sends a distinct Discord alert when posting fails, because a milestone that passes unannounced cannot be celebrated retroactively with the same effect.An analytics alert can email a human, but a human posts hours later or not at all. Kestra turns the alert into the publication itself, keeps the four OAuth credentials in secrets, records every public post in the execution history, and guarantees through the errors block that a failed post becomes a loud internal message instead of a silent gap.
X_CONSUMER_KEY: X app consumer key (API key).X_CONSUMER_SECRET: X app consumer secret (API secret).X_ACCESS_TOKEN: OAuth 1.0a access token for the posting account.X_ACCESS_SECRET: OAuth 1.0a access secret for the posting account.DISCORD_WEBHOOK_URL: Discord incoming webhook for internal notes and failure alerts.MILESTONE_WEBHOOK_KEY: secret key guarding the milestone webhook endpoint.bearerToken, as shown in the plugin documentation.