Open OhBonsai opened 11 months ago
We already support running in worker mode. It doesn’t run the http server. If thats what you are asking for
On Mon, 3 Jul 2023 at 20:18, Bonsai @.***> wrote:
It's good for triggering workflow by api. But sometimes i wanna run my workflow in command mode. I wanna keep my workflow definition.
package amin
import ( "fmt" flow "github.com/s8sg/goflow/flow/v1" )
// Workload function func node1(data []byte, option map[string][]string) ([]byte, error) { result := fmt.Sprintf("(Executing node 1 with data (%s))", string(data)) fmt.Println(result) return []byte(result), nil }
// DefineWorkflow Define provide definition of the workflow func DefineWorkflow(workflow flow.Workflow, context flow.Context) error { dag := workflow.Dag() dag.Node("node1", node1) return nil }
then run this workflow in main
workflow.Run("my-workflow")
— Reply to this email directly, view it on GitHub https://github.com/s8sg/goflow/issues/76, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABYIJ2R2LADGHOPST7DXTY3XOLBBXANCNFSM6AAAAAAZ4OLWZQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
We already support running in worker mode. It doesn’t run the http server. If thats what you are asking for
In worker mode, we need to connect to Redis to store and process task states and results. However, I hope to keep only the definition of workflows and not need to connect to Redis. Because my workerload is running in different network environments and the worker nodes can only connect to the server via HTTP to get tasks.
Can you explain more like why you require only the definition?
implement a SQLite state store, maybe a good idea
It's good for triggering workflow by api. But sometimes i wanna run my workflow in command mode. I wanna keep my workflow definition.
then run this workflow in main