1import type * as sfn from "@distilled.cloud/aws/sfn";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { StateMachine } from "./StateMachine.ts";
5
6export interface DescribeExecutionRequest extends sfn.DescribeExecutionInput {}
7
8/**
9 * Runtime binding for `states:DescribeExecution`.
10 *
11 * Bind this operation to a {@link StateMachine} inside a function runtime to
12 * poll the status and output of that machine's executions. IAM access is
13 * scoped to executions of the bound state machine.
14 * ### Polling Executions
15 * **Example:** Check an execution's status
16 * ```typescript
17 * const describeExecution = yield* StepFunctions.DescribeExecution(machine);
18 *
19 * const execution = yield* describeExecution({ executionArn });
20 * // execution.status: "RUNNING" | "SUCCEEDED" | "FAILED" | ...
21 * ```
22 *
23 * @binding
24 */
25export interface DescribeExecution extends Binding.Service<
26 DescribeExecution,
27 "AWS.StepFunctions.DescribeExecution",
28 (
29 stateMachine: StateMachine,
30 ) => Effect.Effect<
31 (
32 request: DescribeExecutionRequest,
33 ) => Effect.Effect<sfn.DescribeExecutionOutput, sfn.DescribeExecutionError>
34 >
35> {}
36export const DescribeExecution = Binding.Service<DescribeExecution>(
37 "AWS.StepFunctions.DescribeExecution",
38);