New to Kestra?
Use blueprints to kickstart your first workflows.
Find stale Pipedrive deals on a schedule with Kestra. List open deals, flag any past their expected close date, and report each one to Discord.
Deals do not fail loudly. They fail by sitting in a stage past the date everyone agreed they would close, while the forecast quietly stops being true. This blueprint runs a weekly sweep with io.kestra.plugin.pipedrive.deals.List, iterates every open deal with io.kestra.plugin.core.flow.Loop, and posts one Discord message per deal whose expected close date has already passed. Each alert names the deal, its value, and the missed date, so the Monday standup starts with a concrete list instead of a gut feeling.
list_open_deals (io.kestra.plugin.pipedrive.deals.List, fetchType: FETCH, status: open) pulls up to 100 open deals into the execution as {{ outputs.list_open_deals.deals }}.loop_deals (io.kestra.plugin.core.flow.Loop) fans out over the deal list; inside the loop each deal is decoded with fromJson(item.value).flag_if_stale (io.kestra.plugin.core.flow.If) checks that the deal carries an expectedCloseDate and that the date, converted with the timestamp filter, is earlier than now(). Deals without an expected close date are deliberately skipped, keeping the check conservative and free of false alarms.report_stale_deal posts one Discord message per hit, reading the deal fields through item.value, which is accessible from any depth inside the Loop, including inside the If.errors block posts a distinct Discord alert if the sweep itself fails, and a disabled-by-default Schedule trigger runs the sweep every Monday at 08:00.Pipedrive stores the expected close date but does not chase it for you. Kestra turns that dormant field into an active control: a scheduled sweep, per-deal branching logic, and channel delivery, all declared in YAML with execution history showing exactly which deals were flagged in every run. Changing the staleness rule is editing one Pebble expression, not rebuilding a workflow in a UI.
PIPEDRIVE_API_TOKEN: Pipedrive API token.DISCORD_WEBHOOK_URL: Discord incoming webhook URL.disabled: false on the weekly trigger and adjust the cron to land before your pipeline review.limit or pass the nextCursor output into a follow-up run to cover pipelines larger than one page.pipelineId, stageId, or ownerId on the list task to give each team its own alert channel.io.kestra.plugin.pipedrive.deals.Update inside the If branch to push the deal into a review stage or drop its probability automatically.