chore: regenerate examples (#2291)

Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
github-actions[bot]
2025-09-11 12:50:17 -04:00
committed by GitHub
parent 49772f76fd
commit ba803abdfc
5 changed files with 10 additions and 0 deletions

View File

@@ -35,6 +35,7 @@ func main() {
selectedWorkflow := (*workflows.Rows)[0]
selectedWorkflowUUID := uuid.MustParse(selectedWorkflow.Metadata.Id)
// > List runs
workflowRuns, err := hatchet.Runs().List(ctx, rest.V1WorkflowRunListParams{
WorkflowIds: &[]types.UUID{selectedWorkflowUUID},
@@ -49,6 +50,7 @@ func main() {
runIds = append(runIds, uuid.MustParse(run.Metadata.Id))
}
// > Cancel by run ids
_, err = hatchet.Runs().Cancel(ctx, rest.V1CancelTaskRequest{
ExternalIds: &runIds,
@@ -57,6 +59,7 @@ func main() {
log.Fatalf("failed to cancel runs by ids: %v", err)
}
// > Cancel by filters
tNow := time.Now().UTC()
@@ -73,5 +76,6 @@ func main() {
log.Fatalf("failed to cancel runs by filters: %v", err)
}
fmt.Println("cancelled all runs for workflow", selectedWorkflow.Name)
}

View File

@@ -37,3 +37,4 @@ func main() {
fmt.Println("\nStreaming completed!")
}

View File

@@ -58,3 +58,4 @@ func main() {
log.Println("Failed to start server:", err)
}
}

View File

@@ -50,6 +50,7 @@ func StreamTask(ctx worker.HatchetContext, input StreamTaskInput) (*StreamTaskOu
}, nil
}
func StreamingWorkflow(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[StreamTaskInput, StreamTaskOutput] {
return factory.NewTask(
create.StandaloneTask{

View File

@@ -43,6 +43,7 @@ func Lower(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[EventInput, Lo
)
}
// > Accessing the filter payload
func accessFilterPayload(ctx worker.HatchetContext, input EventInput) (*LowerTaskOutput, error) {
fmt.Println(ctx.FilterPayload())
@@ -51,6 +52,7 @@ func accessFilterPayload(ctx worker.HatchetContext, input EventInput) (*LowerTas
}, nil
}
// > Declare with filter
func LowerWithFilter(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[EventInput, LowerTaskOutput] {
return factory.NewTask(
@@ -71,6 +73,7 @@ func LowerWithFilter(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[Even
)
}
func Upper(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[EventInput, UpperTaskOutput] {
return factory.NewTask(
create.StandaloneTask{