User-triggered workflow

It might happen that the first step in a workflow is an external user sending data to Next Matter. It might be a customer that wants to move stocks to your company and is filling in a form with the data. Sending the data can then start the stock transfer workflow.

Set up the external trigger

  1. In your Next Matter portal, click Workflows.
  2. Click Create new > Create a new workflow.
  3. Enter the workflow name and click Create.
  4. Click the first step under the workflow overview.
  5. In the Trigger step configuration, click External.
  6. in External portal configuration, click Create portal from first step.
  7. Enter the instance name.

You can send the user the link available in Portal link or generate and send a QR code. You can also place the QR code on your website so that it's available for any customer who wants to partner with you.

🚧

You can generate an external portal link that will automatically create data references. For details, see Pass meta information.

Next steps: 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:
  • Method: POST
  • URL: https://core.nextmatter.com/api/instances/
  • Headers: Content-Type:application/json
  • Headers: Authorization: Your_NextMatter_API_key
  • In the Body enter the following:
    {
        "process": "https://core.nextmatter.com/api/processes/WORKFLOW_ID/",
        "name": "{Instance ID} - Sub-workflow" //use data references to reference the name from step 1
    }
    
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.

  • Click + Create variable and create a ID reference of the value $.id and theURL reference of value $.url.
  1. 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:
    {
           "step_id":STEP_ID,//this is a placeholder
           "actions":[
                  {
                         "action_id":ACTION_ID, //this is a placeholder
                         "input_object":{"inputValue":"TEXT"} //TEST is a placeholder
                  }
           ]
    }
    
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.
Where is the form 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.
  1. Save your changes.