Having trouble running a workflow from a Domo Brick

HalG
HalG Member
edited February 5 in APIs & Domo Developer

There's a brick called Workflow Start Form that I'm basing my implementation on, primarily the function

const startWorkflowWithParams = (alias, params) => {
  
  var startURL = '/domo/workflow/v1/models/' + alias + '/start';
  domo.post(startURL, params).then(data => {
        console.log(data);
        document.getElementById('resultText').innerText = `Workflow '${data.modelName}' started successfully`;
    }).catch(err => {
        console.log(err);
        document.getElementById('resultText').innerText = `Start failed`;
    })

};

Every attempt returns a 404 not found error.

{
"status": 404,
"statusReason": "Not Found",
"message": "No workflow found with the name "RunDataflow"",
"toe": [*omitted, looks like a token of some sort so I probably shouldn't share it]
}

I can't find much on the workflow API. I tried domo.get('/domo/workflow/v1/models') and it returned a list of all workflows, including a name property that matches what I'm trying. I can manually trigger the workflows, so it doesn't seem to be anything wrong with them.

Is this some security limitation? Is there an endpoint that uses the workflow ID instead of an alias I can try? Kind of stumped on this one, nothing I try seems to work.

Best Answer

  • ArborRose
    ArborRose Coach
    Answer ✓


    The error message you're receiving indicates that the Domo API endpoint /domo/workflow/v1/models/RunDataflow/start is returning a 404 Not Found status code, indicating that no workflow was found with the name "RunDataflow".

    Here are a few steps you can take to troubleshoot and resolve this issue:

    1. Verify Workflow Name: Double-check that the workflow alias or name "RunDataflow" is correct. It's possible that there might be a typo or inconsistency in the alias used to identify the workflow.
    2. Check Workflow Existence: Ensure that the workflow named "RunDataflow" exists in your Domo instance. You can verify this by logging into Domo and navigating to the workflows section to see if the specified workflow is present.
    3. Confirm API Endpoint: Confirm that the API endpoint /domo/workflow/v1/models/RunDataflow/start is the correct endpoint for starting the desired workflow. You may need to consult the Domo API documentation or contact Domo support to ensure you're using the correct endpoint.
    4. Permissions: Ensure that the user or authentication token used to make the API request has sufficient permissions to access and execute the specified workflow. Lack of permissions could result in the workflow not being found.
    5. Error Handling: Implement more robust error handling in your code to provide additional information in case of errors. This could include logging more details about the request and response to aid in troubleshooting.

    ** Was this post helpful? Click Agree or Like below. **
    ** Did this solve your problem? Accept it as a solution! **

Answers

  • ArborRose
    ArborRose Coach
    Answer ✓


    The error message you're receiving indicates that the Domo API endpoint /domo/workflow/v1/models/RunDataflow/start is returning a 404 Not Found status code, indicating that no workflow was found with the name "RunDataflow".

    Here are a few steps you can take to troubleshoot and resolve this issue:

    1. Verify Workflow Name: Double-check that the workflow alias or name "RunDataflow" is correct. It's possible that there might be a typo or inconsistency in the alias used to identify the workflow.
    2. Check Workflow Existence: Ensure that the workflow named "RunDataflow" exists in your Domo instance. You can verify this by logging into Domo and navigating to the workflows section to see if the specified workflow is present.
    3. Confirm API Endpoint: Confirm that the API endpoint /domo/workflow/v1/models/RunDataflow/start is the correct endpoint for starting the desired workflow. You may need to consult the Domo API documentation or contact Domo support to ensure you're using the correct endpoint.
    4. Permissions: Ensure that the user or authentication token used to make the API request has sufficient permissions to access and execute the specified workflow. Lack of permissions could result in the workflow not being found.
    5. Error Handling: Implement more robust error handling in your code to provide additional information in case of errors. This could include logging more details about the request and response to aid in troubleshooting.

    ** Was this post helpful? Click Agree or Like below. **
    ** Did this solve your problem? Accept it as a solution! **

  • JosephMeyers
    JosephMeyers Domo Employee

    The name in the start endpoint is the aliased name. When you edit the app you can see the alias names in the wiring screen.