New to Kestra?
Use blueprints to kickstart your first workflows.
Kestra flow with dependent dynamic inputs, stock checks, a Pause approval gate collecting structured onResume inputs, Slack notification, and a chained finance approval subflow.
Model a real procurement chain in a single declarative flow. This Kestra blueprint demonstrates three advanced patterns together: dynamic, dependent inputs populated live from an API; an inventory-aware ordering decision; and a two-stage human-in-the-loop approval where the first reviewer answers structured questions and a second finance approval runs as a subflow. It uses the public dummyjson product API as a stand-in for your catalog, so it runs out of the box, and it links approvers to a companion Kestra App form through appLink() (an Enterprise Edition and Kestra Cloud feature).
category input (SELECT) is populated at execution time by an expression calling the products API with the http() Pebble function; the product input depends on it via dependsOn and reloads its options when the category changes.getProductId task (io.kestra.plugin.core.debug.Return) resolves the chosen title to an id with an inline jq filter, defaulting to -1 when not found.getProductDetails task (io.kestra.plugin.core.http.Request) fetches the product with allowFailed: true so an unknown product does not crash the flow.processOrder task (io.kestra.plugin.core.flow.If) checks the HTTP code and availabilityStatus against the AVAILABLE and LOW variables. In-stock products run a io.kestra.plugin.core.flow.Parallel block that logs inventory, places the order, and fires a restock alert only for low stock. Anything else lands in cancelOrder.hitlProcess block (io.kestra.plugin.core.flow.Sequential) runs only when the order was not cancelled. It logs and posts an approval link to Slack (io.kestra.plugin.slack.notifications.SlackIncomingWebhook), embedding the flow inputs and requestor in the appLink() URL, then pauses with io.kestra.plugin.core.flow.Pause. The onResume schema collects a boolean decision, free-text notes, and a cost center from the approver.sendToVendor summarizes the decision, sendPurchaseOrderForFinanceApproval (io.kestra.plugin.core.flow.Subflow) launches the purchase-order-finance-approval flow, and financeApprovalStatus reports the manager's verdict. Flow-level outputs expose order, invoice, and purchase order status to callers.runIf, and onResume patterns.Approval chains usually end up split across a form tool, a ticketing system, and scripts, with no single record of what was requested, decided, and executed. Kestra keeps the entire chain in one execution graph: inputs are validated and versioned, the pause holds state durably for as long as the approver needs, the structured onResume answers become outputs downstream tasks can branch on, and the finance stage is a reusable subflow other processes can call too. The companion App gives approvers a clean form without granting them access to the Kestra UI.
purchase-order-finance-approval flow deployed in the same namespace.appLink() resolves (EE or Kestra Cloud); without one, replace the link with an execution URL.SLACK_WEBHOOK: Slack incoming webhook URL used by notifyChannel.SLACK_WEBHOOK secret to your Kestra namespace.purchase-order-finance-approval, then this flow.Return stubs with real vendor API calls or ERP tasks.timeout behavior to the Pause tasks to auto-escalate stale approvals.Switch task.