New to Kestra?
Use blueprints to kickstart your first workflows.
Audit Pipedrive contact data with Kestra. List persons monthly, count missing emails and owners in Python, and post a CRM hygiene report to Discord.
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.
list_persons (io.kestra.plugin.pipedrive.persons.List, fetchType: FETCH) pulls up to 500 person records into the execution as {{ outputs.list_persons.persons }}.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.total_persons, missing_email_count, missing_owner_count, and complete_count through the ::{"outputs": {...}}:: protocol.report interpolates the four scalars into a single Discord message.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.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.
Process task runner.PIPEDRIVE_API_TOKEN: Pipedrive API token.DISCORD_WEBHOOK_URL: Discord incoming webhook URL.disabled: false on the monthly trigger.nextCursor output into repeated list calls before computing.io.kestra.plugin.pipedrive.persons.Update after the report to assign a default owner to unowned contacts automatically.