Skip to main content
The executor.Plugin interface is the extension point for all task execution logic in Aether. Every distinct type of work — HTTP calls, shell commands, data transforms, or any custom logic — is implemented as a Plugin. The engine dispatches tasks to plugins via the broker; plugins return structured outputs and an exit code that the engine maps to a Phase.

Plugin interface

func() string
Returns the unique executor type identifier string (e.g. "http", "shell", "echo"). This string must match the executor.type field in workflow task definitions.
func() model.ExecutorSchema
Declares the executor’s input/output contract. Use SchemaOf[Config, Output]() to derive this from struct types rather than writing field names by hand.
func(ctx, *ExecuteRequest) (*model.ExecOutputs, error)
Runs the task. Use OutputFrom for type-safe output construction. Return ExecCodeSuspended to pause execution until Engine.Resume() is called.

ExecuteRequest

*model.Inputs
Fully resolved task inputs. Use BindInputs(req.Inputs, &myConfig) to deserialize into a typed config struct.
string
Duration string forwarded from TaskAssignment. The plugin should respect this independently of the context — for example, pass it to a subprocess or remote API call.
int
Number of retries already consumed. 0 = first attempt. Useful for logging or backoff logic inside the plugin.

ExecOutputs and ExecCode

The Code field drives the engine’s phase assignment:
The engine is the sole Phase writer. Plugins return an ExecCode integer; the engine maps it to a Phase. Users can override this mapping with phaseConditions expressions on the task, except for Skipped and Cancelled which are exclusively engine semantics.

OutputFrom helper

OutputFrom converts a flat output struct to *model.ExecOutputs by reflecting on its fields. The json tag on each field becomes the parameter name.
Example usage:

BindInputs helper

BindInputs maps model.Inputs.Parameters into a typed config struct by matching parameter names to json struct tags.
Example:

SchemaOf

SchemaOf derives an ExecutorSchema by reflecting on Config and Output struct types. Use executor.DynamicOutputs as the output type for executors with runtime-determined outputs.
Example:

executor.Registry

The Registry manages registered plugins, routing task dispatch by Type(). It is created automatically when you call WithExecutor(), or you can create one manually and pass it with WithExecutorRegistry().
func(Plugin) error
Adds a plugin. Returns an error if the type identifier is already registered. Also caches the plugin’s Schema() result.
func(model.ExecutorSchema)
Registers a schema without a local plugin instance. Used by distributed brokers to propagate remote worker schemas to the master for validation.

Minimal executor example

Inject with WithExecutor