1import type * as mwaa from "@distilled.cloud/aws/mwaa-serverless";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Workflow } from "./Workflow.ts";
5
6/**
7 * Request accepted by the {@link StartWorkflowRun} runtime callable. The
8 * `WorkflowArn` is injected from the bound {@link Workflow}; the idempotency
9 * `ClientToken` is auto-generated when omitted.
10 */
11export type StartWorkflowRunInput = Omit<
12 mwaa.StartWorkflowRunRequest,
13 "WorkflowArn"
14>;
15
16/**
17 * Runtime binding for `airflow-serverless:StartWorkflowRun`.
18 *
19 * Starts an on-demand run of the bound {@link Workflow} — the serverless
20 * equivalent of triggering a DAG. The workflow ARN is injected from the
21 * binding; the caller can override workflow parameters or pin a specific
22 * workflow version. Provide the implementation with
23 * `Effect.provide(AWS.MWAAServerless.StartWorkflowRunHttp)`.
24 * ### Running Workflows
25 * **Example:** Start An On-Demand Run
26 * ```typescript
27 * // init — bind the operation to the workflow
28 * const startWorkflowRun = yield* AWS.MWAAServerless.StartWorkflowRun(workflow);
29 *
30 * // runtime
31 * const run = yield* startWorkflowRun({
32 * OverrideParameters: { date: "2026-07-15" },
33 * });
34 * yield* Effect.log(`started run ${run.RunId} (${run.Status})`);
35 * ```
36 *
37 * @binding
38 */
39export interface StartWorkflowRun extends Binding.Service<
40 StartWorkflowRun,
41 "AWS.MWAAServerless.StartWorkflowRun",
42 (
43 workflow: Workflow,
44 ) => Effect.Effect<
45 (
46 request?: StartWorkflowRunInput,
47 ) => Effect.Effect<
48 mwaa.StartWorkflowRunResponse,
49 mwaa.StartWorkflowRunError
50 >
51 >
52> {}
53export const StartWorkflowRun = Binding.Service<StartWorkflowRun>(
54 "AWS.MWAAServerless.StartWorkflowRun",
55);