Giter Site home page Giter Site logo

Comments (1)

glime-ai avatar glime-ai commented on June 26, 2024

To notify a business system about the changed status of an activity or workflow, you can use a combination of webhook events and custom activity execution middleware in Elsa Workflows. Here are the steps you can follow:

  1. Webhook Events: Configure webhook events in your workflow to send notifications to the business system's endpoint when certain activities are executed or when the workflow reaches a specific state. You can set up a webhook event to trigger on events like RunTask as shown in the external application integration guide. The business system needs to expose an endpoint to receive these webhook calls.

  2. Custom Activity Execution Middleware: Implement custom activity execution middleware that gets executed for each activity. This middleware can publish notifications like ActivityExecuting and ActivityExecuted. You can use this middleware to send custom notifications to your business system whenever an activity's status changes.

  3. Event Handling: For Elsa 2, you can handle the ActivityExecuted notification to know when an activity is completed. For Elsa 3, you can implement a similar mechanism by using custom middleware components.

  4. Conductor Activities: Use RunTask and EventReceived activities from Elsa.Activities.Conductor to orchestrate tasks and events between the workflow and the business system. The business system can send events to the workflow to start or resume execution by triggering EventReceived activities.

  5. Webhook Endpoint: Ensure that your business system has a webhook endpoint that the workflow server can invoke to notify about task execution or other events.

  6. Signal Mechanism: Although the Elsa signaling mechanism is designed to send signals to workflows and not directly to business systems, you can use it in conjunction with the above methods to orchestrate complex interactions.

Remember to configure your workflow and business system to handle these notifications appropriately. You may need to implement additional logic in your business system to process the incoming data from the workflow and update the system's state accordingly.

from elsa-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.