> ## Documentation Index
> Fetch the complete documentation index at: https://help.nextmatter.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Launch instances automatically

> You can automatically start instances when another workflow completes and send data from one workflow to a step in another one.

## Automatically launch a new instance

1. Click **+ Add step** and create a form with the form fields the external user needs to fill in.
2. Create a new **Integrations > Custom integrations** step. It will be used to automatically launch the workflow.
3. Click **Settings** on the step, and enter the following details:

   <Accordion title="Where is the workflow ID?">
     You can get the ID by clicking the follow-up workflow and copying the number from the URL in your browser.

     <Frame>
       <img src="https://mintcdn.com/nextmatter/2sBPfWILWLfMdiFz/images/docs/f07c902-workflow_ID.png?fit=max&auto=format&n=2sBPfWILWLfMdiFz&q=85&s=fe8b23e20beaf1f8300f2ad40ee5d0f2" alt="Image of the workflow ID in Next Matter URL" width="1456" height="399" data-path="images/docs/f07c902-workflow_ID.png" />
     </Frame>
   </Accordion>

   * Click **+ Create variable** and create an `ID` reference of the value `$.id` and the `URL` reference of the value `$.url`.
   * **Method**: POST
   * **URL**:
   * **Headers**: Content-Type: `application/json`
   * **Headers**: Authorization: `Your_NextMatter_API_key`
   * In the **Body** enter the following:

     <CodeGroup>
       ```json JSON theme={null}
       {
           "process": "https://core.nextmatter.com/api/processes/WORKFLOW_ID/",
           "name": "{Instance ID} - Sub-workflow"
       }
       ```
     </CodeGroup>
4. Save your changes.

## Send data to the instance step

1. Create a new **Integrations > Custom integrations** step. It will be used to send data to the new instance and automatically complete the first step of the instance.
2. Click **Settings** on the step, and enter the following details:
   * **Method**: POST
   * **URL**: `https://core.nextmatter.com/api/instances/{3.Launch - Launch workflow automatically - ID (plain)}/complete_step/`
   * **Headers**: Content-Type: `application/json`
   * **Headers**: Authorization: `Your_NextMatter_API_key`
   * In the **Body** enter the following:

     <CodeGroup>
       ```json JSON theme={null}
       {
              "step_id": "STEP_ID",
              "actions":[
                     {
                            "action_id": "ACTION_ID",
                            "input_object":{"inputValue":"TEXT"}
                     }
              ]
       }
       ```
     </CodeGroup>

     <Accordion title="Where is the step ID?">
       1. In your left-hand navigation, click the **Workflows** icon.
       2. Hover over the follow-up workflow and click on the menu icon.
       3. Click **Edit workflow**.
       4. Click the step to which you'd like to send data.
       5. Copy the step ID. It's the last number in the URL you see in your browser.

       <Frame>
         <img src="https://mintcdn.com/nextmatter/Z3-w3RiDibcpWWcE/images/docs/0fe28db-step_ID.png?fit=max&auto=format&n=Z3-w3RiDibcpWWcE&q=85&s=074bea0e822de5a4432af82fea894791" alt="Image of the step ID in Next Matter URL" width="1457" height="821" data-path="images/docs/0fe28db-step_ID.png" />
       </Frame>
     </Accordion>

     <Accordion title="Where is the form field ID?">
       1. In your left-hand navigation, click the **Workflows** icon.
       2. Hover over the follow-up workflow and click on the menu icon.
       3. Click **Edit workflow**.
       4. Click the step to which you'd like to send data.
       5. Click the ID icon for the field to which you want to copy data.
       6. Copy **Form field ID**.

       <Frame>
         <img src="https://mintcdn.com/nextmatter/I7XEPsBmVpUZVtva/images/docs/42d2505-form_id.png?fit=max&auto=format&n=I7XEPsBmVpUZVtva&q=85&s=8141ab2e1f85ac033a2bfda5b78e61c5" alt="Image of the Form field ID in Next Matter" width="2940" height="1504" data-path="images/docs/42d2505-form_id.png" />
       </Frame>
     </Accordion>
3. Save your changes.
