Call Element Workflow from API

Hi Guys,

I’ld like to be able to make certain workflows accessible via an API, so for example, when you click on the “create a new Thing” button element, I’ve got a workflow that will go and create that Thing based on filled in fields, but I also want to be able to create the same thing via an API call to the app.

I currently see my options as either:
1/ Simply duplicate the functionality in both element and API workflows. Not good as it relies on manually syncing workflows, or
2/ Create a custom API workflow and call that from both the API endpoint workflow and also the element workflow. Should basically work, but requires element designers to think ahead and is not really a natural approach for creating UI workflows

What would be ideal would be if instead of calling an API workflow from an element, I could call an element workflow from the API, as if element fields were filled in and the submit button pressed when the API endpoint was called.

Does anybody know if this is possible, or if there’s a better way?



Not possible in the way you describe. “API Workflows” are on the server, so they have no “elements” as such as there is no “screen” they are working with.

But I think you already know that :slight_smile:

I think 2) is probably the way to do, but it is a much more architectural thing than the initial design you are right.

Personally I tend to go for 1) initially, and then curse and refactor to 2) when it becomes an issue.

Thanks Nigel! Yeah, I kind of came to that conclusion, but thought maybe I was missing an option and better to ask. It seems there is some cursing to be done then… Thanks!

This topic was automatically closed after 70 days. New replies are no longer allowed.