pipelines icon indicating copy to clipboard operation
pipelines copied to clipboard

{{ all_variables.json() }}

Open c3aw opened this issue 8 years ago • 3 comments

Would be a graet way to retrieve all variables (prompt/vars combined) as JSON, say for example to pass the information to a REST endpoint.

c3aw avatar Jan 20 '17 02:01 c3aw

We have been thinking to start using Jinja2 as the templating engine and they just merged a tojson filter two weeks ago. That would allow to do something like {{ all_vars | tojson }} inside an action. We'd still need to add the all_vars parameter but that should be simple.

@c3aw just to be clear what kind of use case do you have in mind? Can you post an example action if you have one?

JuhaS avatar Jan 20 '17 04:01 JuhaS

@JuhaS the use case is to submit JSON payloads to REST services. I've submitted a terrible PR that works for me (but does the job nicely). I think a more generic REST action would be great though!

c3aw avatar Jan 23 '17 03:01 c3aw

@JuhaS I think we should extend the webhook plugin to allow webhook actions (with a payload).

hunvreus avatar Jan 23 '17 03:01 hunvreus