Skip to content

Implement push-based Workflow and Execution updates to Studio via websocket #109

@chrisli30

Description

@chrisli30

Previously we made a decision to use polling to retrieve workflows and executions, but there are many drawbacks for implementing workflow/execution updates on the client side.

My rationale

When a workflow is triggered, AVS handles a single execution at a time. After the trigger finishes, the resulting event or data is appended to a queue. However, the Studio currently retrieves the entire queue during polling and recalculates it to identify the single item that has changed.

This process could be significantly simplified if we push the single event directly to the Studio.

Advantages of Push-based updates

  1. Simplified process:
    • The Studio backend can host a single WebSocket connection to AVS, subscribing to different channels as needed.
    • A secret key can be used to secure the connection and project different channels.
  2. Event-specific channels, which could include
    • Workflow events: Creation, cancellation, deletion, or status changes (e.g., “Completed”).
    • Execution events: Start of an execution, success, or error outcomes.

Drawbacks of polling on the client side of Studio

  1. Finding a single object or status change from an array is error0prone. If any attribute of workflow or execution change, the code would need to update. It’d be much better if we can push the single event from AVS to user directly.
  2. The tranverse of array is costly on cilent side. If not handled carefully, it will cause re-render of some or all page components slowing down the workflow page, especially if polling occurs every few seconds.
  3. Although polling works in the beginnning, the number of API calls will add up quickly with a short interval for every user.

Overall, the User Notification feature of the Studio depends on this AVS feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Priority Level 3

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions