List icon
Script icon
Process icon
DiscordIncomingWebhook icon
Schedule icon

Monthly Pipedrive Contact Hygiene Report to Discord

Audit Pipedrive contact data with Kestra. List persons monthly, count missing emails and owners in Python, and post a CRM hygiene report to Discord.

Categories
Business

Every CRM decays, and telling reps to fill in their fields has never once worked. What works is a number with a trend. This blueprint lists persons with io.kestra.plugin.pipedrive.persons.List, hands the records to a Python step that counts contacts missing an email address or an owner, and posts the totals to Discord on the first of every month. Hygiene becomes a metric the team watches move, not an accusation.

How it works

  1. list_persons (io.kestra.plugin.pipedrive.persons.List, fetchType: FETCH) pulls up to 500 person records into the execution as {{ outputs.list_persons.persons }}.
  2. compute_hygiene (io.kestra.plugin.scripts.python.Script on the Process task runner) receives the records as JSON through the PERSONS_JSON environment variable. It counts persons with an empty emails list and persons with no owner set, reading the owner field defensively under both key casings.
  3. The script emits total_persons, missing_email_count, missing_owner_count, and complete_count through the ::{"outputs": {...}}:: protocol.
  4. report interpolates the four scalars into a single Discord message.
  5. The errors block posts a distinct Discord alert when the check fails, and a disabled-by-default Schedule trigger runs the report on the first of each month at 08:00.

What you get

  • Contact quality expressed as four numbers a channel can absorb in five seconds.
  • A monthly cadence that turns data cleanup into a measurable trend instead of a one-off purge.
  • Missing owners surfaced explicitly, which is where unrouted leads go to die.
  • A failure alert, because a hygiene report that silently stops running is itself a hygiene problem.

Who it's for

  • Revenue operations teams who own CRM data quality and need evidence rather than anecdotes.
  • Sales managers deciding whether the next hire is a rep or a data cleanup sprint.
  • Marketing teams whose email campaigns bounce off contacts that were never complete.

Why orchestrate this with Kestra

Hygiene audits usually live in a spreadsheet someone builds quarterly and abandons. Kestra makes the audit a scheduled flow with history: every month's numbers are attached to an execution, the logic is versioned YAML plus twenty lines of Python, and extending the definition of a complete record is a one-line change reviewed like any other code.

Prerequisites

  • A Pipedrive account and API token.
  • A Kestra worker with Python available for the Process task runner.
  • A Discord incoming webhook for the report and failure alerts.

Secrets

  • PIPEDRIVE_API_TOKEN: Pipedrive API token.
  • DISCORD_WEBHOOK_URL: Discord incoming webhook URL.

Quick start

  1. Add both secrets to your Kestra namespace.
  2. Execute the flow manually and compare the Discord numbers against a spot check in Pipedrive.
  3. Set disabled: false on the monthly trigger.

How to extend

  • Add phone coverage or custom field completeness to the Python checks and extend the payload with the new scalars.
  • Page through larger contact books by feeding the nextCursor output into repeated list calls before computing.
  • Chain io.kestra.plugin.pipedrive.persons.Update after the report to assign a default owner to unowned contacts automatically.
  • Store each month's numbers in a database with a JDBC task to chart the trend over time.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.