trigger exposed workflow on success of an API call
Hi , maybe I ’m overcomplicating things here , but I just can ’t wrap my head around how to make this work . I ´ve tried to illustrate it (hopefully this makes it a bit clearer ) . So I have a provider component with my apis . The api is wrapped in a workflow that is exposed in context so it can be called by the child components . Let ´s assume that child component 1 runs the exposed workflow "W1 " on load (that part is already working ) . Now comes the part that gives me a headache : ON SUCCESS of that api call I would like to call custom action "1 " . How do I wait for the success event ? Events can ´t be exposed and running another exposed workflow doesn ´t work because based on what should I run it ? I have multiple child components and everyone of them needs to call a different action . Also I don ´t want every child component to have their individual api . Is there a way to accomplish this ? Thanks If you don 't always want to call it , you can set up a switch statement in the success flow to dictate whether or not to call it That condition can be set by the workflow you 're using to trigger the initial call Could be the call is set to auto -fetch then it is also being called onLoad or somethign similar Also , sounds like the custom action could have a check for existing instances so it doesn 't call things it doesn 't need to And /or change your custom actions to check for existing instances 👍1The call itself is a post request and not set to autofetch . It just returns different client secrets . The problem might really be the custom action that intializes stripe multiple times . I already tried to work on that earlier but it somewhere says that I need to intialize stripe for every component and I can ´t call two components by using the same initialization . I ´ll try to figure something out . Thanks for your help @Lucas G 🙏 It would hacky and honestly not ideal But it could technically work I 'd avoid that though and just update the custom actions to check for existing instances