:doc:`Omics <../../omics>` / Client / create_workflow

***************
create_workflow
***************



.. py:method:: Omics.Client.create_workflow(**kwargs)

  

  Creates a private workflow. Before you create a private workflow, you must create and configure these required resources:

   

  
  * *Workflow definition file:* A workflow definition file written in WDL, Nextflow, or CWL. The workflow definition specifies the inputs and outputs for runs that use the workflow. It also includes specifications for the runs and run tasks for your workflow, including compute and memory requirements. The workflow definition file must be in ``.zip`` format. For more information, see `Workflow definition files <https://docs.aws.amazon.com/omics/latest/dev/workflow-definition-files.html>`__ in Amazon Web Services HealthOmics. 

    
    * You can use Amazon Q CLI to build and validate your workflow definition files in WDL, Nextflow, and CWL. For more information, see `Example prompts for Amazon Q CLI <https://docs.aws.amazon.com/omics/latest/dev/getting-started.html#omics-q-prompts>`__ and the `Amazon Web Services HealthOmics Agentic generative AI tutorial <https://github.com/aws-samples/aws-healthomics-tutorials/tree/main/generative-ai>`__ on GitHub.
    

  
   
  * *(Optional) Parameter template file:* A parameter template file written in JSON. Create the file to define the run parameters, or Amazon Web Services HealthOmics generates the parameter template for you. For more information, see `Parameter template files for HealthOmics workflows <https://docs.aws.amazon.com/omics/latest/dev/parameter-templates.html>`__.
   
  * *ECR container images:* Create container images for the workflow in a private ECR repository, or synchronize images from a supported upstream registry with your Amazon ECR private repository.
   
  * *(Optional) Sentieon licenses:* Request a Sentieon license to use the Sentieon software in private workflows.
  

   

  For more information, see `Creating or updating a private workflow in Amazon Web Services HealthOmics <https://docs.aws.amazon.com/omics/latest/dev/creating-private-workflows.html>`__ in the *Amazon Web Services HealthOmics User Guide*.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/CreateWorkflow>`_  


  **Request Syntax**
  ::

    response = client.create_workflow(
        name='string',
        description='string',
        engine='WDL'|'NEXTFLOW'|'CWL'|'WDL_LENIENT',
        definitionZip=b'bytes',
        definitionUri='string',
        main='string',
        parameterTemplate={
            'string': {
                'description': 'string',
                'optional': True|False
            }
        },
        storageCapacity=123,
        tags={
            'string': 'string'
        },
        requestId='string',
        accelerators='GPU',
        storageType='STATIC'|'DYNAMIC',
        containerRegistryMap={
            'registryMappings': [
                {
                    'upstreamRegistryUrl': 'string',
                    'ecrRepositoryPrefix': 'string',
                    'upstreamRepositoryPrefix': 'string',
                    'ecrAccountId': 'string'
                },
            ],
            'imageMappings': [
                {
                    'sourceImage': 'string',
                    'destinationImage': 'string'
                },
            ]
        },
        containerRegistryMapUri='string',
        readmeMarkdown='string',
        parameterTemplatePath='string',
        readmePath='string',
        definitionRepository={
            'connectionArn': 'string',
            'fullRepositoryId': 'string',
            'sourceReference': {
                'type': 'BRANCH'|'TAG'|'COMMIT',
                'value': 'string'
            },
            'excludeFilePatterns': [
                'string',
            ]
        },
        workflowBucketOwnerId='string',
        readmeUri='string'
    )
    
  :type name: string
  :param name: 

    Name (optional but highly recommended) for the workflow to locate relevant information in the CloudWatch logs and Amazon Web Services HealthOmics console.

    

  
  :type description: string
  :param description: 

    A description for the workflow.

    

  
  :type engine: string
  :param engine: 

    The workflow engine for the workflow. This is only required if you have workflow definition files from more than one engine in your zip file. Otherwise, the service can detect the engine automatically from your workflow definition.

    

  
  :type definitionZip: bytes
  :param definitionZip: 

    A ZIP archive containing the main workflow definition file and dependencies that it imports for the workflow. You can use a file with a ://fileb prefix instead of the Base64 string. For more information, see `Workflow definition requirements <https://docs.aws.amazon.com/omics/latest/dev/workflow-defn-requirements.html>`__ in the *Amazon Web Services HealthOmics User Guide*.

    

  
  :type definitionUri: string
  :param definitionUri: 

    The S3 URI of a definition for the workflow. The S3 bucket must be in the same region as the workflow.

    

  
  :type main: string
  :param main: 

    The path of the main definition file for the workflow. This parameter is not required if the ZIP archive contains only one workflow definition file, or if the main definition file is named “main”. An example path is: ``workflow-definition/main-file.wdl``.

    

  
  :type parameterTemplate: dict
  :param parameterTemplate: 

    A parameter template for the workflow. If this field is blank, Amazon Web Services HealthOmics will automatically parse the parameter template values from your workflow definition file. To override these service generated default values, provide a parameter template. To view an example of a parameter template, see `Parameter template files <https://docs.aws.amazon.com/omics/latest/dev/parameter-templates.html>`__ in the *Amazon Web Services HealthOmics User Guide*.

    

  
    - *(string) --* 

    
      - *(dict) --* 

        A workflow parameter.

        

      
        - **description** *(string) --* 

          The parameter's description.

          

        
        - **optional** *(boolean) --* 

          Whether the parameter is optional.

          

        
      


  :type storageCapacity: integer
  :param storageCapacity: 

    The default static storage capacity (in gibibytes) for runs that use this workflow or workflow version. The ``storageCapacity`` can be overwritten at run time. The storage capacity is not required for runs with a ``DYNAMIC`` storage type.

    

  
  :type tags: dict
  :param tags: 

    Tags for the workflow. You can define up to 50 tags for the workflow. For more information, see `Adding a tag <https://docs.aws.amazon.com/omics/latest/dev/add-a-tag.html>`__ in the *Amazon Web Services HealthOmics User Guide*.

    

  
    - *(string) --* 

    
      - *(string) --* 

      


  :type requestId: string
  :param requestId: **[REQUIRED]** 

    An idempotency token to ensure that duplicate workflows are not created when Amazon Web Services HealthOmics submits retry requests.

    This field is autopopulated if not provided.

  
  :type accelerators: string
  :param accelerators: 

    The computational accelerator specified to run the workflow.

    

  
  :type storageType: string
  :param storageType: 

    The default storage type for runs that use this workflow. The ``storageType`` can be overridden at run time. ``DYNAMIC`` storage dynamically scales the storage up or down, based on file system utilization. ``STATIC`` storage allocates a fixed amount of storage. For more information about dynamic and static storage types, see `Run storage types <https://docs.aws.amazon.com/omics/latest/dev/workflows-run-types.html>`__ in the *Amazon Web Services HealthOmics User Guide*.

    

  
  :type containerRegistryMap: dict
  :param containerRegistryMap: 

    (Optional) Use a container registry map to specify mappings between the ECR private repository and one or more upstream registries. For more information, see `Container images <https://docs.aws.amazon.com/omics/latest/dev/workflows-ecr.html>`__ in the *Amazon Web Services HealthOmics User Guide*.

    

  
    - **registryMappings** *(list) --* 

      Mapping that provides the ECR repository path where upstream container images are pulled and synchronized.

      

    
      - *(dict) --* 

        If you are using the ECR pull through cache feature, the registry mapping maps between the ECR repository and the upstream registry where container images are pulled and synchronized.

        

      
        - **upstreamRegistryUrl** *(string) --* 

          The URI of the upstream registry.

          

        
        - **ecrRepositoryPrefix** *(string) --* 

          The repository prefix to use in the ECR private repository.

          

        
        - **upstreamRepositoryPrefix** *(string) --* 

          The repository prefix of the corresponding repository in the upstream registry.

          

        
        - **ecrAccountId** *(string) --* 

          Account ID of the account that owns the upstream container image.

          

        
      
  
    - **imageMappings** *(list) --* 

      Image mappings specify path mappings between the ECR private repository and their corresponding external repositories.

      

    
      - *(dict) --* 

        Specifies image mappings that workflow tasks can use. For example, you can replace all the task references of a public image to use an equivalent image in your private ECR repository. You can use image mappings with upstream registries that don't support pull through cache. You need to manually synchronize the upstream registry with your private repository.

        

      
        - **sourceImage** *(string) --* 

          Specifies the URI of the source image in the upstream registry.

          

        
        - **destinationImage** *(string) --* 

          Specifies the URI of the corresponding image in the private ECR registry.

          

        
      
  
  
  :type containerRegistryMapUri: string
  :param containerRegistryMapUri: 

    (Optional) URI of the S3 location for the registry mapping file.

    

  
  :type readmeMarkdown: string
  :param readmeMarkdown: 

    The markdown content for the workflow's README file. This provides documentation and usage information for users of the workflow.

    

  
  :type parameterTemplatePath: string
  :param parameterTemplatePath: 

    The path to the workflow parameter template JSON file within the repository. This file defines the input parameters for runs that use this workflow. If not specified, the workflow will be created without a parameter template.

    

  
  :type readmePath: string
  :param readmePath: 

    The path to the workflow README markdown file within the repository. This file provides documentation and usage information for the workflow. If not specified, the ``README.md`` file from the root directory of the repository will be used.

    

  
  :type definitionRepository: dict
  :param definitionRepository: 

    The repository information for the workflow definition. This allows you to source your workflow definition directly from a code repository.

    

  
    - **connectionArn** *(string) --* **[REQUIRED]** 

      The Amazon Resource Name (ARN) of the connection to the source code repository.

      

    
    - **fullRepositoryId** *(string) --* **[REQUIRED]** 

      The full repository identifier, including the repository owner and name. For example, 'repository-owner/repository-name'.

      

    
    - **sourceReference** *(dict) --* 

      The source reference for the repository, such as a branch name, tag, or commit ID.

      

    
      - **type** *(string) --* **[REQUIRED]** 

        The type of source reference, such as branch, tag, or commit.

        

      
      - **value** *(string) --* **[REQUIRED]** 

        The value of the source reference, such as the branch name, tag name, or commit ID.

        

      
    
    - **excludeFilePatterns** *(list) --* 

      A list of file patterns to exclude when retrieving the workflow definition from the repository.

      

    
      - *(string) --* 

      
  
  
  :type workflowBucketOwnerId: string
  :param workflowBucketOwnerId: 

    The Amazon Web Services account ID of the expected owner of the S3 bucket that contains the workflow definition. If not specified, the service skips the validation.

    

  
  :type readmeUri: string
  :param readmeUri: 

    The S3 URI of the README file for the workflow. This file provides documentation and usage information for the workflow. Requirements include:

     

    
    * The S3 URI must begin with ``s3://USER-OWNED-BUCKET/``
     
    * The requester must have access to the S3 bucket and object.
     
    * The max README content length is 500 KiB.
    

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'arn': 'string',
          'id': 'string',
          'status': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETED'|'FAILED'|'INACTIVE',
          'tags': {
              'string': 'string'
          },
          'uuid': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **arn** *(string) --* 

        The workflow's ARN.

        
      

      - **id** *(string) --* 

        The workflow's ID.

        
      

      - **status** *(string) --* 

        The workflow's status.

        
      

      - **tags** *(dict) --* 

        The workflow's tags.

        
        

        - *(string) --* 
          

          - *(string) --* 
    
  
      

      - **uuid** *(string) --* 

        The universally unique identifier (UUID) value for this workflow.

        
  
  **Exceptions**
  
  *   :py:class:`Omics.Client.exceptions.InternalServerException`

  
  *   :py:class:`Omics.Client.exceptions.ServiceQuotaExceededException`

  
  *   :py:class:`Omics.Client.exceptions.ThrottlingException`

  
  *   :py:class:`Omics.Client.exceptions.ValidationException`

  
  *   :py:class:`Omics.Client.exceptions.ConflictException`

  
  *   :py:class:`Omics.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`Omics.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`Omics.Client.exceptions.RequestTimeoutException`

  