r/workflow • u/sayzlim • Dec 18 '14
Workflow Tips for Beginners
I realize MacStories has covered an in-depth review for Workflow, so I’m just going to share a few tips I’ve learned while tinkering with this automation app.
If you have other tips to share, please leave it in comment so we can help each other getting the best out of this app.
Read: Workflow Tips for Beginners
Follow Up: Evernote Workflows
1
u/wattloewe Dec 18 '14
Thanks for this. I'm a beginner in Workflow and this helps me very much! Maybe you give some more examples?
1
u/sayzlim Dec 18 '14 edited Dec 18 '14
I have another post in progress that shows the workflows I’ve built with the these tips. No advanced JSON parsing though, as I want to keep the workflows built as simple as possible.
1
u/Eximo84 Dec 18 '14
Nice guide - i would like some help with Data Dictionaries.
I tried to parse some JSON and then get a single variable from the JSON but Workflow just crashes. I assume its a memory thing and that the JSON i passed in was too large?
1
u/sayzlim Dec 18 '14
It’s possible, but it can also because the bug with Workflow. I think it’s better to test it out with other sources to make sure it’s the size of JSON that causes this issue.
1
u/philgr Dec 18 '14
Whenever you do Get Contents of URLs to get a JSON response and Workflow throws you a "invalid type" error when you try to Get Dictionary from Input, that's because the request sends the wrong Content-Type, usually text/html when it should be application/json.
There's no workaround for this apart from asking the API developer to send the correct header. Usually I just get a different API.
1
u/AriX Workflow Team Dec 19 '14
There is a workaround! Usually you can just put Get Text from Input before Get Dictionary from Input. Let me know if that doesn't work in your case.
1
u/danielstucke Dec 20 '14
I had this problem in my stock price workflow. json came with a html header that I didn't want and caused the wrong content-type error. Solved it by stripping just the json out using a Match Text reggae to pull out the braces {}. https://workflow.is/workflows/a0415e2f1f1d4471b9b467a0e5d7314c
1
8
u/rhithyn Dec 18 '14
Quite a nice article! The one thing I found handy is if you have an error in your script that you don't know where or why it's happening, place a "View Contents in Graph" or "Quick Look" node at the bottom of your workflow and then re-run it.
If you hit your error and haven't seen your node, move the node up one and re-try. Eventually, you'll get to see your node results first (either a graph of the data or a quick look at the contents) and the next node is very likely the failing node.
With the data being presented to you, you can see what's being passed to the next node and hopefully surmise why it's failing.
Another tip: if you're being asked to "choose an item" and you don't have a choose in your list at that point, it's most likely that the data is a list of items and the next element can only work with single entries. Either a "repeat with each", "Get item" or "combine text" (basically, a way to flatten your list or pick an entry) needs to happen at that point.