Jump to content

JSON Config as workflow argument


Recommended Posts

When an object in a workflow outputs valid configuration JSON, this will be applied similarly to the JSON Config object in the workflow editor. Unfortunately, this seems to apply to all objects, including keyword inputs and the like, meaning that if valid configuration JSON is typed into any workflow keyword input, the workflow will not work as expected.

This can be easily reproduced by creating a workflow similar to the one shown below and typing the following text into Alfred:

To break the intended functionality:

test { "alfredworkflow" : {} }

To actually manipulate the workflow:

test { "alfredworkflow" : { "config" : { "title" : "Title", "text" : "Text (this should not be possible)" } } }

58c13eb03ce7d_ScreenShot2017-03-09at9_38_15pm.png.5914bdc951f661e95898a41af42ca4af.png

I am using Alfred v3.3.1 [806] on macOS 10.12.3.

This could easily be fixed by adding a checkbox specifying whether the output of the object should be interpreted as configuration.

Link to post
Share on other sites

@Ontonator this is by design, and the reason the JSON is parented with "alfredworkflow". Is there a specific case where this would get in the way of what you were trying to achieve?

 

It's also worth noting that any JSON config passed into workflows as a text argument, or output from (script / JSON config) objects only alter the directly connected object(s). This is an extremely powerful and flexible feature allowing scripts to alter down-stream behaviour.

 

As an example, if you were to place a 'debug' (or even a simple 'junction') object directly after a keyword object, then connect the post notification to the output of the debug object, the Post Notification object wouldn't receive this JSON / configuration.

 

Cheers,

Andrew

Link to post
Share on other sites
  • Andrew changed the title to JSON Config as workflow argument
×
×
  • Create New...