@@ -19654,11 +19654,13 @@ func PrepareSingleAction(ctx context.Context, user User, appId string, body []by
1965419654
1965519655 OrgId: user.ActiveOrg.Id,
1965619656 Owner: user.Username,
19657+ UpdatedBy: user.Username,
1965719658 Start: action.ID,
1965819659 },
1965919660 Type: "AGENT",
1966019661 Start: action.ID,
1966119662 Status: "EXECUTING",
19663+ WorkflowId: workflowId,
1966219664 ExecutionId: workflowId,
1966319665 ExecutionOrg: user.ActiveOrg.Id,
1966419666 StartedAt: int64(time.Now().Unix()),
@@ -19842,7 +19844,7 @@ func PrepareSingleAction(ctx context.Context, user User, appId string, body []by
1984219844
1984319845 if len(action.AuthenticationId) > 0 {
1984419846 if debug {
19845- log.Printf("[INFO ][%s] Found auth ID for single action: %s", workflowExecution.ExecutionId, action.AuthenticationId)
19847+ log.Printf("[DEBUG ][%s] Found auth ID for single action: %s", workflowExecution.ExecutionId, action.AuthenticationId)
1984619848 }
1984719849
1984819850 // FIXME: How do we decide what fields to replace?
@@ -23153,6 +23155,22 @@ func PrepareWorkflowExecution(ctx context.Context, workflow Workflow, request *h
2315323155 }
2315423156 }
2315523157
23158+ agentic := false
23159+ if len(start) == 0 && request != nil {
23160+ decisionId, decisionIdOk := request.URL.Query()["decision_id"]
23161+ if decisionIdOk {
23162+ log.Printf("[INFO][%s] Got decisionId %s inside Agentic decision", oldExecution.ExecutionId, decisionId[0])
23163+
23164+ agentic = true
23165+ if len(workflow.Actions) == 1 {
23166+ start = append(start, workflow.Actions[0].ID)
23167+ oldExecution.Results[0].Status = "WAITING"
23168+ } else {
23169+ log.Printf("[ERROR] No Agentic Start node found for workflow %s during workflow continuation. Decision ID: %s", workflow.ID, decisionId[0])
23170+ }
23171+ }
23172+ }
23173+
2315623174 if len(start) == 0 {
2315723175 log.Printf("[ERROR] No start node found for workflow %s during workflow continuation", workflow.ID)
2315823176 return workflowExecution, ExecInfo{}, fmt.Sprintf("No start node found for workflow continuation %s", workflow.ID), errors.New("No start node found for workflow continuation")
@@ -23164,7 +23182,7 @@ func PrepareWorkflowExecution(ctx context.Context, workflow Workflow, request *h
2316423182 for _, result := range oldExecution.Results {
2316523183 if result.Action.ID == start[0] {
2316623184 if result.Status == "ABORTED" {
23167- log.Printf("[INFO] Found aborted result: %s (%s)", result.Action.Label, result.Action.ID)
23185+ log.Printf("[INFO][%s] Found aborted result: %s (%s)", oldExecution.ExecutionId , result.Action.Label, result.Action.ID)
2316823186 if oldExecution.Status != "ABORTED" {
2316923187 log.Printf("[INFO] Aborting execution %s as it should have already been aborted in the past", oldExecution.ExecutionId)
2317023188 oldExecution.Status = "ABORTED"
@@ -23176,7 +23194,11 @@ func PrepareWorkflowExecution(ctx context.Context, workflow Workflow, request *h
2317623194 }
2317723195 }
2317823196
23179- if result.Status == "WAITING" {
23197+ if agentic {
23198+ log.Printf("[INFO][%s] Should fix the decision by injecting the values and continuing to the next step! :3", oldExecution.ExecutionId)
23199+ //os.Exit(3)
23200+
23201+ } else if result.Status == "WAITING" && !agentic {
2318023202 log.Printf("[INFO][%s] Found relevant User Input result: %s (%s)", result.ExecutionId, result.Action.Label, result.Action.ID)
2318123203
2318223204 var userinputResp UserInputResponse
0 commit comments