Fixed a problem where workflows can't be built

This commit is contained in:
Frikky
2025-05-12 13:15:43 +02:00
parent 319c939c1f
commit 99c01e518d
2 changed files with 14 additions and 3 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ require (
github.com/gorilla/mux v1.8.1
github.com/h2non/filetype v1.1.3
github.com/satori/go.uuid v1.2.0
github.com/shuffle/shuffle-shared v0.8.39
github.com/shuffle/shuffle-shared v0.8.50
golang.org/x/crypto v0.36.0
google.golang.org/api v0.228.0
google.golang.org/grpc v1.71.1
+13 -2
View File
@@ -3039,7 +3039,13 @@ func executeSingleAction(resp http.ResponseWriter, request *http.Request) {
shouldRerun = true
}
workflowExecution, err := shuffle.PrepareSingleAction(ctx, user, fileId, body, runValidationAction)
decisionId := ""
decision, decisionOk := query["decision_id"]
if decisionOk && len(decision) > 0 {
decisionId = decision[0]
}
workflowExecution, err := shuffle.PrepareSingleAction(ctx, user, fileId, body, runValidationAction, decisionId)
debugUrl := fmt.Sprintf("/workflows/%s?execution_id=%s", workflowExecution.Workflow.ID, workflowExecution.ExecutionId)
resp.Header().Add("X-Debug-Url", debugUrl)
@@ -3101,7 +3107,12 @@ func executeSingleAction(resp http.ResponseWriter, request *http.Request) {
return
}
returnBody := shuffle.HandleRetValidation(ctx, workflowExecution, 1)
actionId := ""
if len(workflowExecution.Workflow.Actions) == 1 {
actionId = workflowExecution.Workflow.Actions[0].ID
}
returnBody := shuffle.HandleRetValidation(ctx, workflowExecution, 1, actionId)
returnBytes, err := json.Marshal(returnBody)
if err != nil {
log.Printf("[ERROR] Failed to marshal retStruct in single execution: %s", err)