Skip to main content
Add custom step executors to extend workflow capabilities.

Overview

Step types are handlers that execute specific step configurations. Each type has a dedicated executor in internal/executor/.

Steps to Add a New Step Type

1. Define the Type Constant

Add to internal/core/types.go:

2. Add Step Fields (if needed)

Add fields to internal/core/step.go:

3. Create the Executor

Create internal/executor/mynew_executor.go:

4. Register in Dispatcher

Update internal/executor/dispatcher.go:

5. Add Validation

Update internal/parser/validator.go:

6. Write Tests

Create internal/executor/mynew_executor_test.go:

Example: Custom Notification Step

Usage in workflow:

Best Practices

  1. Always render templates before using step fields
  2. Support context cancellation via ctx.Done()
  3. Return meaningful errors with context
  4. Export useful values via StepResult
  5. Write comprehensive tests
  6. Add validation rules for required fields

Next Steps