create_workflow
async
¶
create_workflow(
name: NameString,
definition_s3_location: DefinitionS3Location,
role_arn: RoleARN,
*,
config_overrides: Optional[AsyncMWAAServerlessClientConfig] = None,
client_token: Optional[IdempotencyTokenString] = None,
code: Optional[Code] = None,
description: Optional[DescriptionString] = None,
encryption_configuration: Optional[EncryptionConfiguration] = None,
logging_configuration: Optional[LoggingConfiguration] = None,
engine_version: Optional[EngineVersion] = None,
network_configuration: Optional[NetworkConfiguration] = None,
tags: Optional[Tags] = None,
trigger_mode: Optional[GenericString] = None,
) -> CreateWorkflowResponse
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.
Parameters:
-
name(NameString) –The name of the workflow. You must use unique workflow names within your Amazon Web Services account. The service generates a unique identifier that is appended to ensure temporal uniqueness across the account lifecycle.
-
client_token(Optional[IdempotencyTokenString], default:None) –A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This token prevents duplicate workflow creation requests.
-
definition_s3_location(DefinitionS3Location) –The Amazon S3 location where the workflow definition file is stored. This must point to a valid YAML file that defines the workflow structure using supported Amazon Web Services operators and tasks. Amazon Managed Workflows for Apache Airflow Serverless takes a snapshot of the definition at creation time, so subsequent changes to the Amazon S3 object will not affect the workflow unless you create a new version. In your YAML definition, include task dependencies, scheduling information, and operator configurations that are compatible with the Amazon Managed Workflows for Apache Airflow Serverless execution environment.
-
code(Optional[Code], default:None) –The location of code artifacts in Amazon S3 for the workflow. The service copies the code from this location at the time of the request.
-
role_arn(RoleARN) –The Amazon Resource Name (ARN) of the IAM role that Amazon Managed Workflows for Apache Airflow Serverless assumes when executing the workflow. This role must have the necessary permissions to access the required Amazon Web Services services and resources that your workflow tasks will interact with. The role is used for task execution in the isolated, multi-tenant environment and should follow the principle of least privilege. Amazon Managed Workflows for Apache Airflow Serverless validates role access during workflow creation but runtime permission checks are performed by the target services.
-
description(Optional[DescriptionString], default:None) –An optional description of the workflow that you can use to provide additional context about the workflow's purpose and functionality.
-
encryption_configuration(Optional[EncryptionConfiguration], default:None) –The configuration for encrypting workflow data at rest and in transit. Specifies the encryption type and optional KMS key for customer-managed encryption.
-
logging_configuration(Optional[LoggingConfiguration], default:None) –The configuration for workflow logging. Specifies the CloudWatch log group where workflow execution logs are stored. Amazon Managed Workflows for Apache Airflow Serverless automatically exports worker logs and task-level information to the specified log group in your account using remote logging functionality. This provides comprehensive observability for debugging and monitoring workflow execution across the distributed, serverless environment.
-
engine_version(Optional[EngineVersion], default:None) –The version of the Amazon Managed Workflows for Apache Airflow Serverless engine that you want to use for this workflow. This determines the feature set, supported operators, and execution environment capabilities available to your workflow. Amazon Managed Workflows for Apache Airflow Serverless maintains backward compatibility across versions while introducing new features and improvements. Currently supports version 1 with plans for additional versions as the service evolves.
-
network_configuration(Optional[NetworkConfiguration], default:None) –Network configuration for the workflow execution environment, including VPC security groups and subnets for secure network access. When specified, Amazon Managed Workflows for Apache Airflow Serverless deploys ECS worker tasks in your customer VPC to provide secure connectivity to your resources. If not specified, tasks run in the service's default worker VPC with network isolation from other customers. This configuration enables secure access to VPC-only resources like RDS databases or private endpoints.
-
tags(Optional[Tags], default:None) –A map of tags to assign to the workflow resource. Tags are key-value pairs that are used for resource organization and cost allocation.
-
trigger_mode(Optional[GenericString], default:None) –The trigger mode for the workflow execution.
Raises:
-
AccessDeniedException–You do not have sufficient permission to perform this action.
-
ConflictException–You cannot create a resource that already exists, or the resource is in a state that prevents the requested operation.
-
InternalServerException–An unexpected server-side error occurred during request processing.
-
OperationTimeoutException–The operation timed out.
-
ServiceQuotaExceededException–The request exceeds the service quota for Amazon Managed Workflows for Apache Airflow Serverless resources. This can occur when you attempt to create more workflows than allowed, exceed concurrent workflow run limits, or surpass task execution limits. Amazon Managed Workflows for Apache Airflow Serverless implements admission control using DynamoDB-based counters to manage resource utilization across the multi-tenant environment. Contact Amazon Web Services Support to request quota increases if you need higher limits for your use case.
-
ThrottlingException–The request was denied because too many requests were made in a short period, exceeding the service rate limits. Amazon Managed Workflows for Apache Airflow Serverless implements throttling controls to ensure fair resource allocation across all customers in the multi-tenant environment. This helps maintain service stability and performance. If you encounter throttling, implement exponential backoff and retry logic in your applications, or consider distributing your API calls over a longer time period.
-
ValidationException–The specified request parameters are invalid, missing, or inconsistent with Amazon Managed Workflows for Apache Airflow Serverless service requirements. This can occur when workflow definitions contain unsupported operators, when required IAM permissions are missing, when S3 locations are inaccessible, or when network configurations are invalid. The service validates workflow definitions, execution roles, and resource configurations to ensure compatibility with the managed Airflow environment and security requirements.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_mwaa_serverless/_services/async_mwaa_serverless.py
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 | |