Importing workflows

Import a workflow and all its dependencies into a specific project.

Before you begin

You need an admin access to import workflows into a project. If you do not have admin access but hold a custom role, verify that you have a write access. Specifically for the project where you intend to import workflows. If a workflow contains any custom actions and a user imports the workflow by using Public API, then the custom actions are overwritten.

About this task

Complete the following steps in the REST client platform where you want to import the workflow. Each time that you make a request, a new workflow is created in the specified project. To overwrite an existing workflow in the project, use a request body parameter in the endpoint URL

Procedure

  1. In a REST client platform, add the details of the tenant where you want to import a workflow.
    
    //In case of Instance API key 
    Headers:
    {
    "x-instance-api-key": "instance_api_key"
    }
     
    // In case of MCSP or ISV token
    Headers:
    {
    "Authorization": "mcsp_or_isv_token"
    }
  2. Make a POST request at the URL of the workflow.

    URL Syntax - <domain>/apis/v1/rest/projects/:project/workflow-import

    In this URL request, /:project is the name of the project where you want to import.

    You can choose to overwrite an existing workflow present in the specified project by using the following request body parameter: overwrite=true
    Note:
    • If the workflow exists and the overwrite flag is not set, a new workflow is created in the specified project.
    • If the workflow exists and the overwrite flag is set, the existing workflow is overwritten with the imported workflow.
    • If the workflow doesn’t exist and the overwrite flag is set, a new workflow is created with the same UID as the exported workflow. If the same workflow is imported again, the existing workflow is overwritten with an updated version number.
    If the request is successful, you receive the response code for success.
    {
    output: 
    	{
    		name: <workflow_name>,
    		description: <workflow_description>,
    		refid: <workflow_refid>,
    		sid: <workflow_sid>,
    		uid: <workflow_uid>,
    		project_uid: <workflow_project_uid>,
    		tenant_uid: <workflow_tenant_uid>
    	}
    }