New to Kestra?
Use blueprints to kickstart your first workflows.
Monitor a Pinecone index with Kestra. Read index stats on a schedule, alert Slack and fail the execution when the vector count drops below a threshold.
A RAG corpus can shrink without any error being raised: a purge targets the wrong namespace, an ingestion job silently stops, a migration drops half the vectors. Retrieval keeps returning results, just worse ones. This blueprint watches the number that gives it away. On a schedule, io.kestra.plugin.pinecone.DescribeIndexStats reads the index and an If task compares totalVectorCount against a minimum threshold. Below it, Slack gets paged and io.kestra.plugin.core.execution.Fail marks the execution failed so the breach shows up in Kestra's UI, metrics, and alerting, not just in a chat channel.
check_stats (io.kestra.plugin.pinecone.DescribeIndexStats) reads the index named by index_name and outputs totalVectorCount, the number of vectors across all namespaces.evaluate_threshold (io.kestra.plugin.core.flow.If) compares that count against the min_vector_count input.alert_low_count pages Slack with the observed count and the threshold, then fail_execution fails the run with an explicit error message.log_healthy writes the count to the logs, turning the execution history into a capacity timeline.errors block posts a Slack message whenever the flow ends in failure, covering both a threshold breach and a broken stats call.Schedule trigger runs the check every six hours.Pinecone reports the stats; someone still has to look at them on a schedule, remember what normal is, and raise a hand when the number is wrong. Kestra runs the readback four times a day, encodes the threshold as an input under version control, and turns a breach into a failed execution with an alert. The monitor itself is monitored: if the stats call breaks, the errors block fires instead of the check silently stopping.
min_vector_count value set just below that size, leaving headroom for normal churn.PINECONE_API_KEY: Pinecone API key with read permission on the index.SLACK_WEBHOOK_URL: Slack incoming webhook URL.PINECONE_API_KEY and SLACK_WEBHOOK_URL secrets to your Kestra namespace.min_vector_count above your real count and confirm the Slack alert and failed execution arrive.disabled: false on the every_six_hours trigger.namespaceCounts output map instead of the total.