createWorkflowDefinition method

Future<CreateWorkflowDefinitionResponse> createWorkflowDefinition({
  1. required String name,
  2. String? clientToken,
  3. String? description,
  4. WorkflowExportConfig? exportConfig,
})

Creates a new workflow definition template that can be used to execute multiple workflow runs.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter name : The name of the workflow definition. Must be unique within your account and region.

Parameter clientToken : A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

Parameter description : An optional description of the workflow definition's purpose and functionality.

Parameter exportConfig : Configuration for exporting workflow execution data to Amazon Simple Storage Service.

Implementation

Future<CreateWorkflowDefinitionResponse> createWorkflowDefinition({
  required String name,
  String? clientToken,
  String? description,
  WorkflowExportConfig? exportConfig,
}) async {
  final $payload = <String, dynamic>{
    'name': name,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'description': description,
    if (exportConfig != null) 'exportConfig': exportConfig,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/workflow-definitions',
    exceptionFnMap: _exceptionFns,
  );
  return CreateWorkflowDefinitionResponse.fromJson(response);
}