New to Kestra?
Use blueprints to kickstart your first workflows.
Read a CSV file, convert it to ION, and publish each row as a message to a RabbitMQ exchange with Kestra. Automate queue ingestion from structured data.
id: produce-to-rabbitmq
namespace: company.team
inputs:
- id: order
type: STRING
tasks:
- id: publish_to_rabbitmq
type: io.kestra.plugin.amqp.Publish
host: amqp://guest:guest@localhost:5672/
exchange: test-queue
from:
- data: "{{ read(inputs.order) }}"
Turn a structured CSV file into a stream of RabbitMQ messages without writing custom producer code. This blueprint receives a single order record as an input and publishes it to a RabbitMQ (AMQP) exchange using the io.kestra.plugin.amqp.Publish task. Paired with a fan-out parent flow, it lets you ingest an entire dataset row by row into a message queue, solving the common problem of bridging batch files (exports, reports, order dumps) into event-driven, queue-based consumers.
order input of type STRING that carries one record (the URI of a one-row ION file produced by the parent flow).publish_to_rabbitmq task of type io.kestra.plugin.amqp.Publish connects to the broker via the host AMQP URI and targets the exchange named test-queue.from property reads the record with {{ read(inputs.order) }} and publishes its content as a message to the exchange.To load a full file, run a parent flow that downloads the CSV, converts it, and fans out one execution per row:
id: read_orders
namespace: company.team
tasks:
- id: csv
type: io.kestra.plugin.fs.http.Download
uri: "https://huggingface.co/datasets/kestra/datasets/raw/main/csv/orders.csv"
- id: csv_to_ion
type: io.kestra.plugin.serdes.csv.CsvToIon
from: "{{ outputs.csv.uri }}"
- id: each
type: io.kestra.plugin.core.flows.ForEachItem
items: "{{ outputs.csv_to_ion.uri }}"
batch:
rows: 1
namespace: company.team
flowId: produce_to_rabbitmq
wait: true
transmitFailed: true
inputs:
order: "{{ taskrun.items }}"
RabbitMQ moves messages but does not schedule, source, or transform the data that feeds it. Kestra fills that gap. You can trigger ingestion on a schedule or on an event, retry failed publishes automatically, and fan out one execution per row with ForEachItem so every record gets its own traceable run with full lineage. The entire pipeline is declarative YAML, version controlled and reviewable, instead of a bespoke producer service you have to deploy and babysit.
host URI.test-queue) the producer can publish to.This blueprint uses inline demo credentials (guest/guest) in the host URI and references no Kestra secrets. For production, move the broker URL and credentials into a secret, for example {{ secret('RABBITMQ_URL') }}.
docker run -it --rm --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:latest
http://localhost:15672/ and log in with guest/guest.read_orders parent flow to your namespace.read_orders. It fans out one produce_to_rabbitmq execution per CSV row, each publishing a message to the exchange.exchange and add a routing key to target specific queues.serdes source (JSON, Avro, Parquet).batch.rows to publish multiple records per execution.errors branch to alert on failed publishes.