-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(framework,api): add source when triggered from workflow #6504
base: next
Are you sure you want to change the base?
feat(framework,api): add source when triggered from workflow #6504
Conversation
…synced-workflow-from
…synced-workflow-from
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job spotting all the uses in the trigger flow. I was surprised to see that we're passing the bridge URL by default. This means that for every request, we’re relying less on the state stored in the database.
As a result, instead of querying the database for workflow entities and control variables, the API performs a bridge discovery request and sends the data to the trigger engine.
In my opinion, this isn’t the expected behavior. We might need to add a new flag to explicitly decide whether the flow should be stateful or stateless.
@rifont What do you think about this? Let me know if you need more context. I’m a bit concerned about giving users the option to choose an unsynced (stateless) flow. |
…synced-workflow-from
…synced-workflow-from
…synced-workflow-from
…synced-workflow-from
…synced-workflow-from
commit: |
…synced-workflow-from
What changed? Why was the change needed?
Fix: Triggering a workflow from the bridge app, without syncing the workflow resulted in a successful trigger. Instead, should throw an error.
The tricky part with this "bug" is that there are multiple other cases where we do want to allow trigger of an un-synced workflow (like studio test trigger, trigger of the onboarding playground). They all reach the same api code snippet, as they contain a bridgeUrl, what I was looking for was to find a way to "force" this case, of
workflowIdentifier.trigger
to signal that this one does require a sync unlike the others.The best way I found, that I felt was the most clean and still works with all other different usecases we have at this moment, is to add the __source to the payload to indicate that. When the functionality grows, we would need to do it in a more clever way - not only here but for all "stateless" workflows. Maybe have an explicit flag as part of the trigger structure, but that would be a major change for the context of this issue
Screenshots
Expand for optional sections
Related enterprise PR
Special notes for your reviewer