Starting a workflow from a Domo App
I've been following the guide (https://developer.domo.com/portal/81056f6209bfc-start-a-workflow-from-an-app) for starting a workflow from an app but have been unable to get it working. When I check the console after attempting to initiate the workflow from the app, I'm getting a 404 error, line 401 from domo.ts "Failed to load resource: the server responded with a status of 404 ()". I'm not experienced with JavaScript and assume the problem is me doing something silly, so maybe someone here can straighten me out!
Here is the code (simplified as much as possible!) initiated by an HTML button:
var domo = window.domo;
function submit() {
domo.post('/domo/workflow/v1/models/testapp/start', {CaseNo: "123456", EntryID: "1", Fee: 25000.01});
};
Screenshot of the manifest workflows section:
The workflow currently requires 3 parameters to start, but I've also tried a version of the workflow where the 3 parameters were part of an object which also did not work.
Just in case it's relevant, I converted my code from a brick to an app and the app is currently part of an Domo apps page.
Thanks for any advice!
Best Answer
-
I'm excited you're trying to use workflows and pro-code apps! I've looked into this and it looks like the pro-code editor has a bug resulting in this 404 error being returned. I will create a ticket to get this resolved.
That being said, there is a workaround you can use to get moving. Here are the steps:
- Find the title of your workflows start shape, by default this is "Start {workflowName}"
2. Open the Json editor for your manifest.json file in the pro-code editor
3. Edit the "startName" property on your workflow mapping to be equal to the title for your workflows start
shape4. Finally, save the manifest.json file to refresh the app preview so you can start your app!
Please let me know if this doesn't work for you and we can troubleshoot further.0
Answers
-
Can you show me the workflow start shape showing required parameters, and can you show me the part of your app where you're making the call? Specifically the JS where you're making this call.
0 -
I'm excited you're trying to use workflows and pro-code apps! I've looked into this and it looks like the pro-code editor has a bug resulting in this 404 error being returned. I will create a ticket to get this resolved.
That being said, there is a workaround you can use to get moving. Here are the steps:
- Find the title of your workflows start shape, by default this is "Start {workflowName}"
2. Open the Json editor for your manifest.json file in the pro-code editor
3. Edit the "startName" property on your workflow mapping to be equal to the title for your workflows start
shape4. Finally, save the manifest.json file to refresh the app preview so you can start your app!
Please let me know if this doesn't work for you and we can troubleshoot further.0 -
Okay, I see you have your code here.
For me when I'm learning, I start super simple. Remove all the required start parameters from the workflow and see that you can successfully start the workflow without the start parameters. Isolate where the issue might be occurring.
It would be helpful for me, if you could share the entire app code. Then I can do some testing on my side.0 -
Here is the app code I am using for reference
// Index.html <html> <head> <link rel="stylesheet" href="app.css"> </head> <body> <h1>hello_world</h1> <!-- domo.js optional utils --> <script src="https://unpkg.com/ryuu.js"></script> <script src="app.js"></script> </body> </html> // app.js domo.post('/domo/workflow/v1/models/myWorkflow/start', { myInput: {name:"bob"} }) .then(function(alias){ console.log("alias", alias); });
You can see my manifest.json file in the screenshot above, but that's all there is to it!
0 -
Ah ha! That was it. Changing the startName in the manifest did indeed fix the issue. Workflow started up correctly after changing it.
Thanks both of you for the help!
1
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 622 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 744 Beast Mode
- 58 App Studio
- 41 Variables
- 686 Automate
- 176 Apps
- 453 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 395 Distribute
- 113 Domo Everywhere
- 276 Scheduled Reports
- 6 Software Integrations
- 125 Manage
- 122 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive