How do I create a global workflow?

  • A-Chivas

    21 days ago

    I have created a notification message and I need to set them on almost all create and update APIs, and I need to manually do it for like 20 api calls and this is success and error messages separate would be great if I could do them faster, is this possible?
  • Ben H

    21 days ago

    I'm not sure the "best practices" way to do this, but one option would be to put your workflow inside a component. You can then add that component to any other page or component that needs that workflow. You can name the component "notification-provider" so that its function is clear, and you can add display:contents to the CSS of the component so it doesn't affect your layout. You can set an attribute on the component to provide dynamic input data to the workflow. You can then trigger the workflow either by sharing context with child components, or else by toggling an attribute and making use of the “On attribute change” lifecycle inside the component.
  • A-Chivas

    21 days ago

    can the workflow be part of the same notification component, since notification is a component by itself
  • Ben H

    21 days ago

    Yeah, you can add whatever you see fit to the component. Give it a slot so that you can add children to it / put it wherever in your HTML tree.
  • A-Chivas

    21 days ago

    aight I'll give it a shot

Stop scrolling. Start building.

toddle is a visual web app builder that rivals custom code — but accessible to your entire team!

Try toddle — it's free!

© Copyright 2024 toddle. All rights reserved.