Flower is a powerful and flexible Go library for creating and executing workflows. It provides a simple and intuitive way to define workflows using a declarative YAML syntax and execute them programmatically.
- Define workflows using a simple and expressive YAML syntax
- Execute workflows programmatically using the Flower engine
- Built-in support for common actions (e.g., print, sleep, http)
- Extensible architecture for adding custom actions
- Comprehensive error handling and logging capabilities
- Lightweight and easy to integrate into existing Go projects
Flower includes a number of built-in actions that can be used in workflows:
-
Core Actions:
-
core/test/print
: Print a message to the console -
Request Actions:
-
request/http
: Perform an HTTP request -
request/grpc
: Perform a gRPC request -
request/ws
: Perform a WebSocket request -
request/ftp
: Perform an FTP request -
request/sftp
: Perform an SFTP request -
request/ssh
: Perform an SSH request -
request/sql
: Perform an SQL request -
Parsing Actions:
-
parsing/regex
: Perform a regular expression match -
parsing/xpath
: Extract data from XML using XPath -
parsing/jsonpath
: Extract data from JSON using JSONPath -
parsing/delimiter
: Split a string using a delimiter
To install the Flower library, use the following command:
go get github.com/Velka-DEV/flower
Here's a simple example of how to use Flower to define and execute a workflow:
package main
import (
"fmt"
"github.com/Velka-DEV/flower/pkg/flower"
)
func main() {
// Define the workflow using YAML syntax
workflowYAML := `
name: Example Workflow
steps:
- id: step1
name: Print Hello
action: core/print
inputs:
message: Hello, World!
`
// Parse the workflow YAML
workflow, err := flower.FromYaml([]byte(workflowYAML))
if err != nil {
panic(err)
}
// Create a new Flower runtime
runtime := flower.NewRuntime()
// Set the workflow in the runtime
runtime.SetFlow(workflow)
// Execute the workflow
err = runtime.Run(nil)
if err != nil {
panic(err)
}
}
For more detailed examples and usage instructions, please refer to the examples directory.
Contributions are welcome! If you'd like to contribute to Flower, please follow these steps:
- Fork the repository
- Create a new branch for your feature or bug fix
- Make your changes and commit them with descriptive commit messages
- Push your changes to your forked repository
- Submit a pull request to the main repository
Please ensure that your code follows the existing coding style and includes appropriate tests.
Flower is released under the GPLv3 License.
If you have any questions, suggestions, or feedback, please feel free to contact us at:
- Email: [email protected]
- GitHub Issues: https://github.com/Velka-DEV/flower/issues
We appreciate your interest in Flower and look forward to hearing from you!