-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] How to run workflow without middleware independency #76
Comments
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
<#76>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABYIJ2R2LADGHOPST7DXTY3XOLBBXANCNFSM6AAAAAAZ4OLWZQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
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? |
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
The text was updated successfully, but these errors were encountered: