import type * as constructs from 'constructs'; import type { OnDemandTriggerOptions, ScheduledTriggerOptions, EventTriggerOptions, ConditionalTriggerOptions } from './trigger-options'; import * as cdk from '../../../core'; import type { ITriggerRef } from '../glue.generated'; /** * The base interface for Glue Workflow * * @see {@link Workflow} * @see https://docs.aws.amazon.com/glue/latest/dg/workflows_overview.html */ export interface IWorkflow extends cdk.IResource { /** * The name of the workflow * @attribute */ readonly workflowName: string; /** * The ARN of the workflow * @attribute */ readonly workflowArn: string; /** * Add an on-demand trigger to the workflow. * * @returns a reference to the created trigger. */ addOnDemandTrigger(id: string, options: OnDemandTriggerOptions): ITriggerRef; /** * Add a scheduled trigger to the workflow. * * @returns a reference to the created trigger. */ addScheduledTrigger(id: string, options: ScheduledTriggerOptions): ITriggerRef; /** * Add an EventBridge event-based trigger to the workflow. * * @returns a reference to the created trigger. */ addEventTrigger(id: string, options: EventTriggerOptions): ITriggerRef; /** * Add a conditional (predicate-based) trigger to the workflow. * * @returns a reference to the created trigger. */ addConditionalTrigger(id: string, options: ConditionalTriggerOptions): ITriggerRef; } /** * Properties for importing a Workflow using its attributes */ export interface WorkflowAttributes { /** * The name of the workflow to import */ readonly workflowName: string; /** * The ARN of the workflow to import * * @default - derived from the workflow name */ readonly workflowArn?: string; } /** * Properties for defining a Workflow */ export interface WorkflowProps { /** * Name of the workflow * * @default - a name will be generated */ readonly workflowName?: string; /** * A description of the workflow * * @default - no description */ readonly description?: string; /** * A map of properties to use when this workflow is executed * * @default - no default run properties */ readonly defaultRunProperties?: { [key: string]: string; }; /** * The maximum number of concurrent runs allowed for the workflow * * @default - no limit */ readonly maxConcurrentRuns?: number; } /** * Base abstract class for Workflow * * @see https://docs.aws.amazon.com/glue/latest/dg/about-triggers.html */ export declare abstract class WorkflowBase extends cdk.Resource implements IWorkflow { /** * Extract workflowName from arn */ protected static extractNameFromArn(scope: constructs.Construct, workflowArn: string): string; abstract readonly workflowName: string; abstract readonly workflowArn: string; /** * Add an on-demand trigger to the workflow. * * @param id The id of the trigger. * @param options Additional options for the trigger. * @returns a reference to the created trigger. */ addOnDemandTrigger(id: string, options: OnDemandTriggerOptions): ITriggerRef; /** * Add a scheduled trigger to the workflow. * * @param id The id of the trigger. * @param options Additional options for the trigger, including the schedule. * @returns a reference to the created trigger. */ addScheduledTrigger(id: string, options: ScheduledTriggerOptions): ITriggerRef; /** * Add an EventBridge event-based trigger to the workflow. * * @param id The id of the trigger. * @param options Additional options for the trigger. * @returns a reference to the created trigger. */ addEventTrigger(id: string, options: EventTriggerOptions): ITriggerRef; /** * Add a conditional (predicate-based) trigger to the workflow. * * @param id The id of the trigger. * @param options Additional options for the trigger. * @returns a reference to the created trigger. */ addConditionalTrigger(id: string, options: ConditionalTriggerOptions): ITriggerRef; private renderPredicate; private renderEventBatchingCondition; protected buildWorkflowArn(scope: constructs.Construct, workflowName: string): string; } /** * This module defines a construct for creating and managing AWS Glue Workflows and Triggers. * * AWS Glue Workflows are orchestration services that allow you to create, manage, and monitor complex extract, transform, and load (ETL) activities involving multiple crawlers, jobs, and triggers. Workflows are designed to allow you to manage interdependent jobs and crawlers as a single unit, making it easier to orchestrate and monitor complex ETL pipelines. * * Triggers are used to initiate an AWS Glue Workflow. You can configure different types of triggers, such as on-demand, scheduled, event-based, or conditional triggers, to start your Workflow based on specific conditions or events. * * @see https://docs.aws.amazon.com/glue/latest/dg/workflows_overview.html * @see https://docs.aws.amazon.com/glue/latest/dg/about-triggers.html * * ## Usage Example * * ```ts * const app = new App(); * const stack = new Stack(app, 'TestStack'); * * // Create a Glue Job * declare const role: iam.IRole; * declare const script: glue.Code; * const job = new glue.PySparkStreamingJob(stack, 'ImportedJob', { role, script }); * * // Create a Glue Workflow * const workflow = new glue.Workflow(stack, 'TestWorkflow'); * * // Add an on-demand trigger to the Workflow * workflow.addOnDemandTrigger('OnDemandTrigger', { * actions: [glue.Action.job(job)], * }); * ``` */ export declare class Workflow extends WorkflowBase { /** Uniquely identifies this class. */ static readonly PROPERTY_INJECTION_ID: string; /** * Import a workflow from its name */ static fromWorkflowName(scope: constructs.Construct, id: string, workflowName: string): IWorkflow; /** * Import a workflow from its name */ static fromWorkflowArn(scope: constructs.Construct, id: string, workflowArn: string): IWorkflow; /** * Import an existing workflow */ static fromWorkflowAttributes(scope: constructs.Construct, id: string, attrs: WorkflowAttributes): IWorkflow; private resource; constructor(scope: constructs.Construct, id: string, props?: WorkflowProps); get workflowName(): string; get workflowArn(): string; }