Skip to content

Commit 6cb807d

Browse files
authored
fix workflows (#30)
## πŸšͺ Why? fix ability to run workflows ## πŸ”‘ What? currently `POST workflows/steam` Mastra's API endpoint is not streaming but immediately returns 200. This breaks logic that relies on streaming finished to understand when the result is ready. Use `POST workflows/streamVNext` meanwhile `stream` is broken.
1 parent 3aa8c73 commit 6cb807d

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

β€ŽGemfile.lockβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
ai (0.5.0)
4+
ai (0.5.1)
55
actionpack (>= 7.1.3)
66
activesupport (>= 7.1.3)
77
json_schemer (~> 2.4.0)

β€Žlib/ai/clients/mastra.rbβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def run_workflow(workflow_name, input:)
9797
end
9898

9999
# Step 2: Stream the workflow – we only need to consume the stream so that we know when it finishes
100-
stream_url = URI.join(@base_uri, "api/workflows/#{workflow_name}/stream?runId=#{run_id}")
100+
stream_url = URI.join(@base_uri, "api/workflows/#{workflow_name}/streamVNext?runId=#{run_id}")
101101
stream_request_body = { inputData: JSON.parse(input.to_json), runtimeContext: {} }.to_json
102102
stream_response =
103103
http_post(stream_url, body: stream_request_body, stream: true) do |response|

β€Žlib/ai/version.rbβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# frozen_string_literal: true
33

44
module Ai
5-
VERSION = '0.5.0'
5+
VERSION = '0.5.1'
66
end

β€Žspec/fixtures/vcr_cassettes/mastra_workflow_run.ymlβ€Ž

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
Β (0)