New to Kestra?
Use blueprints to kickstart your first workflows.
Seed a MongoDB collection with realistic fake data. Kestra generates 100 mock JSON people records with DataGen and bulk-loads them in one declarative flow.
Need a MongoDB collection full of realistic test data without writing a seeding script? This blueprint generates 100 mock people records (names, emails, addresses, skills, timestamps) as a JSON file with the Kestra DataGen plugin, then bulk-loads that file into a MongoDB collection. It solves the recurring problem of populating dev, staging, or demo databases with believable documents so you can test queries, indexes, dashboards, and downstream pipelines against data that looks real, all from declarative YAML with no throwaway scripts to maintain.
datagen task (io.kestra.plugin.datagen.core.Generate) produces fake records using a JsonObjectGenerator. It builds each document from Faker expressions like #{name.fullName}, #{internet.emailAddress}, and #{address.city}, mixes in a static age, a skills array, and a ts field set with {{ now() }}. With batchSize: 100 and store: true, the output is written to Kestra internal storage as a JSON file.send_to_mongodb task (io.kestra.plugin.mongodb.Load) reads that file from {{ outputs.datagen.uri }} and bulk-inserts every record into the target collection. The connection uri, database, and collection all come from secrets, so no credentials live in the flow.address.city, address.zip) and array fields (skills) to exercise real document shapes.DataGen and MongoDB have no shared scheduler to tie generation and loading together. Kestra orchestrates both as one declarative flow: it passes the generated file between tasks via {{ outputs.datagen.uri }}, adds retries and alerting on failure, tracks execution lineage and logs, and lets you trigger seeding on a schedule, from an API call, or on demand. You get reproducible, observable data seeding that a standalone generator or a raw mongoimport command cannot coordinate on its own.
MONGO_URI: the MongoDB connection string used by connection.uri.DATABASE_NAME: the target database name.COLLECTION_NAME: the target collection name.MONGO_URI, DATABASE_NAME, and COLLECTION_NAME to your Kestra instance.datagen task writes a JSON file and send_to_mongodb loads every record.JsonObjectGenerator value map to match your own schema, adding or removing fields and Faker expressions.batchSize to seed more records per run.locale to generate region-specific names and addresses.