Skip to content

Commit

Permalink
Fixed a point where user input trigger fails onprem due to GetOrg uti…
Browse files Browse the repository at this point in the history
…lization for api verification
  • Loading branch information
frikky committed Jan 21, 2024
1 parent 3fe5c1e commit bca6ecc
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -18387,8 +18387,7 @@ func DecideExecution(ctx context.Context, workflowExecution WorkflowExecution, e
executed = append(executed, action.ID)
continue
} else {
//log.Printf("Should stop after this iteration because it's user-input based. %s", action)
log.Printf("[DEBUG] Should stop after this iteration because it's user-input based.") //%s", action)
log.Printf("[DEBUG][%s] Should stop after this iteration because it's user-input based.", workflowExecution.ExecutionId)

trigger := Trigger{}
for _, innertrigger := range workflowExecution.Workflow.Triggers {
Expand Down Expand Up @@ -18510,18 +18509,18 @@ func DecideExecution(ctx context.Context, workflowExecution WorkflowExecution, e
})
}

log.Printf("Starting with sourcenode '%s'", trigger.ID)
log.Printf("[DEBUG][%s] Starting with user input sourcenode '%s'", workflowExecution.ExecutionId, trigger.ID)
action.Parameters = append(action.Parameters, WorkflowAppActionParameter{
Name: "source_node",
Value: trigger.ID,
})

// If sms/email, it should be setting the apikey based on the org
syncApikey := workflowExecution.Authorization
if project.Environment != "cloud" {
if project.Environment != "cloud" && project.Environment != "worker"{
org, err := GetOrg(ctx, workflowExecution.ExecutionOrg)
if err == nil {
log.Printf("Got syncconfig key: %s", org.SyncConfig.Apikey)
log.Printf("[DEBUG] Got syncconfig key: %s", org.SyncConfig.Apikey)
syncApikey = org.SyncConfig.Apikey
} else {
log.Printf("[ERROR] Failed to get org %s: %s", workflowExecution.ExecutionOrg, err)
Expand Down

0 comments on commit bca6ecc

Please sign in to comment.