DEV Community

Hamid RM
Hamid RM

Posted on

Introducing go-workflow-engine: A Plug-and-Play Workflow Solution

A while ago, I needed a clean workflow orchestration solution for a Go project. Nothing massive—just a simple, reliable way to define steps, track execution, handle failures, and keep business processes organized.

I checked out several existing tools, but many felt too heavy or required infrastructure I didn’t want to introduce. So I built my own.

Today I’m open-sourcing go-workflow-engine!

Why Another Workflow Engine?

  • Keep it lightweight and easy to integrate into existing Go apps
  • Make persistence modular — no forced database
  • Use an event-driven design so your application can react naturally
  • Stay flexible instead of locking you into a big platform

The engine is meant to become part of your application, not a separate service.

What a Workflow Looks Like

Workflows are defined in simple JSON. Here’s a minimal example:

{
  "workflow_type": "approval",
  "initial_step": "submit",
  "initial_state": "Pending",
  "steps": [
    {
      "name": "submit",
      "title": "Submit Request",
      "actions": [
        {
          "name": "SUBMIT",
          "next_step": "review",
          "new_state": "Submitted"
        }
      ]
    },
    {
      "name": "review",
      "title": "Review Request",
      "actions": [
        {
          "name": "APPROVE",
          "next_step": "done",
          "new_state": "Approved"
        },
        {
          "name": "REJECT",
          "next_step": "submit",
          "new_state": "Rejected"
        }
      ]
    },
    {
      "name": "done",
      "title": "Completed",
      "actions": []
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

The engine takes care of running the workflow while you focus on your business logic.

Key Design Decisions

Every project is different — some teams use PostgreSQL, others MySQL or even custom storage. That’s why I made the persistence layer fully pluggable.

I also built in a clean event system. Workflows emit events at key moments so your application can listen and respond without tight coupling.

Built with AI-Assisted Development

Gemini, Cursor, and MiMo helped speed up research, experimentation, and coding, so I could focus more on architecture and design.

Current Features

  • Simple JSON workflow definitions
  • State tracking and orchestration
  • Event-driven lifecycle handling
  • Modular persistence (in-memory + GORM support)
  • Extensible and lightweight
  • Easy to embed in existing Go applications

Looking for Feedback

This started as a personal tool to solve a recurring need, but I believe other Go developers might find it useful too.

If you want a lightweight workflow engine that embeds nicely into your app without bringing a full platform along, I’d love to hear your thoughts.

Feedback, suggestions, issues, and contributions are all welcome! Feel free to open an issue or PR in the repository.

Top comments (0)