Skip to main content

workflows

Creates, updates, deletes, gets or lists a workflows resource.

Overview

Nameworkflows
TypeResource
Idaws.mwaa_serverless.workflows

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
codeobjectThe Amazon S3 location of the code artifacts provided during workflow creation or update.
code_snapshotted_atstring (date-time)The time at which the code artifacts were copied for this workflow, in ISO 8601 date-time format.
created_atstring (date-time)The timestamp when the workflow was created, in ISO 8601 date-time format.
definition_s3_locationobjectThe Amazon S3 location of the workflow definition file.
descriptionstringThe description of the workflow. (pattern: <code>.+</code>)
encryption_configurationobjectThe encryption configuration for the workflow.
engine_versionintegerThe version of the Amazon Managed Workflows for Apache Airflow Serverless engine that this workflow uses.
logging_configurationobjectThe logging configuration for the workflow.
modified_atstring (date-time)The timestamp when the workflow was last modified, in ISO 8601 date-time format.
namestringThe name of the workflow. (pattern: <code>[a-zA-Z0-9]+[a-zA-Z0-9.-_]*</code>)
network_configurationobjectThe network configuration for the workflow execution environment.
role_arnstringThe Amazon Resource Name (ARN) of the IAM role used for workflow execution. (pattern: <code>arn:aws(?:-(?:cn|us-gov|iso|iso-b|iso-e|iso-f))?:iam::[0-9]{12}:role(/[a-zA-Z0-9+=,.@-]{1,512})*?/[a-zA-Z0-9+=,.@-]{1,64}</code>)
schedule_configurationobjectThe schedule configuration for the workflow, including cron expressions for automated execution. Amazon Managed Workflows for Apache Airflow Serverless uses EventBridge Scheduler for cost-effective, timezone-aware scheduling. When a workflow includes schedule information in its YAML definition, the service automatically configures the appropriate triggers for automated execution. Only one version of a workflow can have an active schedule at any given time.
trigger_modestringThe trigger mode for the workflow execution. (pattern: <code>.*</code>)
workflow_arnstringThe Amazon Resource Name (ARN) of the workflow. (pattern: <code>arn:aws(?:-(?:cn|us-gov|iso|iso-b|iso-e|iso-f))?:airflow-serverless:([a-z]{2}-[a-z]+-[0-9]{1}):([0-9]{12}):workflow/([a-zA-Z0-9][a-zA-Z0-9.-_]{0,254}-[a-zA-Z0-9]{10})</code>)
workflow_definitionstringThe workflow definition content. (pattern: <code>.*</code>)
workflow_statusstringThe current status of the workflow. (READY, DELETING)
workflow_versionstringThe version identifier of the workflow. (pattern: <code>[a-z0-9]{32}</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_workflowselectregionRetrieves detailed information about a workflow, including its configuration, status, and metadata.
list_workflowsselectregionLists all workflows in your account, with optional pagination support. This operation returns summary information for workflows, showing only the most recently created version of each workflow. Amazon Managed Workflows for Apache Airflow Serverless maintains workflow metadata in a highly available, distributed storage system that enables efficient querying and filtering. The service implements proper access controls to ensure you can only view workflows that you have permissions to access, supporting both individual and team-based workflow management scenarios.
create_workflowinsertregion, DefinitionS3Location, RoleArnCreates a new workflow in Amazon Managed Workflows for Apache Airflow Serverless. This operation initializes a workflow with the specified configuration including the workflow definition, execution role, and optional settings for encryption, logging, and networking. You must provide the workflow definition as a YAML file stored in Amazon S3 that defines the DAG structure using supported Amazon Web Services operators. Amazon Managed Workflows for Apache Airflow Serverless automatically creates the first version of the workflow and sets up the necessary execution environment with multi-tenant isolation and security controls.
update_workflowupdateregion, WorkflowArn, DefinitionS3Location, RoleArnUpdates an existing workflow with new configuration settings. This operation allows you to modify the workflow definition, role, and other settings. When you update a workflow, Amazon Managed Workflows for Apache Airflow Serverless automatically creates a new version with the updated configuration and disables scheduling on all previous versions to ensure only one version is actively scheduled at a time. The update operation maintains workflow history while providing a clean transition to the new configuration.
delete_workflowdeleteregionDeletes a workflow and all its versions. This operation permanently removes the workflow and cannot be undone. Amazon Managed Workflows for Apache Airflow Serverless ensures that all associated resources are properly cleaned up, including stopping any running executions, removing scheduled triggers, and cleaning up execution history. The deletion process respects the multi-tenant isolation boundaries and ensures that no residual data or configurations remain that could affect other customers or workflows.
start_workflow_runexecregion, WorkflowArnStarts a new execution of a workflow. This operation creates a workflow run that executes the tasks that are defined in the workflow. Amazon Managed Workflows for Apache Airflow Serverless schedules the workflow execution across its managed Airflow environment, automatically scaling ECS worker tasks based on the workload. The service handles task isolation, dependency resolution, and provides comprehensive monitoring and logging throughout the execution lifecycle.
stop_workflow_runexecregion, WorkflowArn, RunIdStops a running workflow execution. This operation terminates all running tasks and prevents new tasks from starting. Amazon Managed Workflows for Apache Airflow Serverless gracefully shuts down the workflow execution by stopping task scheduling and terminating active ECS worker containers. The operation transitions the workflow run to a STOPPING state and then to STOPPED once all cleanup is complete. In-flight tasks may complete or be terminated depending on their current execution state.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Retrieves detailed information about a workflow, including its configuration, status, and metadata.

SELECT
code,
code_snapshotted_at,
created_at,
definition_s3_location,
description,
encryption_configuration,
engine_version,
logging_configuration,
modified_at,
name,
network_configuration,
role_arn,
schedule_configuration,
trigger_mode,
workflow_arn,
workflow_definition,
workflow_status,
workflow_version
FROM aws.mwaa_serverless.workflows
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a new workflow in Amazon Managed Workflows for Apache Airflow Serverless. This operation initializes a workflow with the specified configuration including the workflow definition, execution role, and optional settings for encryption, logging, and networking. You must provide the workflow definition as a YAML file stored in Amazon S3 that defines the DAG structure using supported Amazon Web Services operators. Amazon Managed Workflows for Apache Airflow Serverless automatically creates the first version of the workflow and sets up the necessary execution environment with multi-tenant isolation and security controls.

INSERT INTO aws.mwaa_serverless.workflows (
Name,
ClientToken,
DefinitionS3Location,
Code,
RoleArn,
Description,
EncryptionConfiguration,
LoggingConfiguration,
EngineVersion,
NetworkConfiguration,
Tags,
TriggerMode,
region
)
SELECT
'{{ Name }}',
'{{ ClientToken }}',
'{{ DefinitionS3Location }}' /* required */,
'{{ Code }}',
'{{ RoleArn }}' /* required */,
'{{ Description }}',
'{{ EncryptionConfiguration }}',
'{{ LoggingConfiguration }}',
{{ EngineVersion }},
'{{ NetworkConfiguration }}',
'{{ Tags }}',
'{{ TriggerMode }}',
'{{ region }}'
RETURNING
created_at,
is_latest_version,
revision_id,
warnings,
workflow_arn,
workflow_status,
workflow_version
;

UPDATE examples

Updates an existing workflow with new configuration settings. This operation allows you to modify the workflow definition, role, and other settings. When you update a workflow, Amazon Managed Workflows for Apache Airflow Serverless automatically creates a new version with the updated configuration and disables scheduling on all previous versions to ensure only one version is actively scheduled at a time. The update operation maintains workflow history while providing a clean transition to the new configuration.

UPDATE aws.mwaa_serverless.workflows
SET
WorkflowArn = '{{ WorkflowArn }}',
DefinitionS3Location = '{{ DefinitionS3Location }}',
Code = '{{ Code }}',
RoleArn = '{{ RoleArn }}',
Description = '{{ Description }}',
LoggingConfiguration = '{{ LoggingConfiguration }}',
EngineVersion = {{ EngineVersion }},
NetworkConfiguration = '{{ NetworkConfiguration }}',
TriggerMode = '{{ TriggerMode }}'
WHERE
region = '{{ region }}' --required
AND WorkflowArn = '{{ WorkflowArn }}' --required
AND DefinitionS3Location = '{{ DefinitionS3Location }}' --required
AND RoleArn = '{{ RoleArn }}' --required
RETURNING
modified_at,
warnings,
workflow_arn,
workflow_version;

DELETE examples

Deletes a workflow and all its versions. This operation permanently removes the workflow and cannot be undone. Amazon Managed Workflows for Apache Airflow Serverless ensures that all associated resources are properly cleaned up, including stopping any running executions, removing scheduled triggers, and cleaning up execution history. The deletion process respects the multi-tenant isolation boundaries and ensures that no residual data or configurations remain that could affect other customers or workflows.

DELETE FROM aws.mwaa_serverless.workflows
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

Starts a new execution of a workflow. This operation creates a workflow run that executes the tasks that are defined in the workflow. Amazon Managed Workflows for Apache Airflow Serverless schedules the workflow execution across its managed Airflow environment, automatically scaling ECS worker tasks based on the workload. The service handles task isolation, dependency resolution, and provides comprehensive monitoring and logging throughout the execution lifecycle.

EXEC aws.mwaa_serverless.workflows.start_workflow_run
@region='{{ region }}' --required
@@json=
'{
"WorkflowArn": "{{ WorkflowArn }}",
"ClientToken": "{{ ClientToken }}",
"OverrideParameters": "{{ OverrideParameters }}",
"WorkflowVersion": "{{ WorkflowVersion }}"
}'
;