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)" } } }


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 comment
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.




Link to comment
Share on other sites

  • Andrew changed the title to JSON Config as workflow argument

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...