Search documentation of Orchid

# Orchid (Orchid v0.3.3)

View Source

The core entry point for the Orchid workflow engine.

This module provides the primary interface (`run/3`) to execute defined Recipes. It is designed to be a flexible and extensible framework for task orchestration.

# Summary

## Functions

inject_opts_into_recipe(recipe, run_opts)
run(recipe, input_params, opts \\ [])

Executes a workflow Recipe.

# Functions

# inject_opts_into_recipe(recipe, run_opts)

# run(recipe, input_params, opts \\ [])

    @spec run(Orchid.Recipe.t(), Orchid.Scheduler.initial_params(), keyword()) ::
      Orchid.Operon.Response.payload() | Orchid.Operon.Response.t()

Executes a workflow Recipe.

It initializes the pipeline, injects any configured middleware (Operons), and starts the execution process.

### Options

- `:return_response` - (boolean) If `true`, returns the full `Orchid.Operon.Response` struct (which includes assigns and metadata) instead of just the result payload. Defaults to `false`.
- `:operons_stack` - (list) A list of additional middleware modules (Recipe-level hooks) to run before the execution phase. They are executed in the order provided.
- `:global_hooks_stack` - (list)
- `:executor_and_opts` - (tuple) Executor module and its options.

### Examples

    # Normal execution returning {:ok, results}
    Orchid.run(my_recipe, initial_params)

    # Execution returning the full Response struct
    Orchid.run(my_recipe, initial_params, return_response: true)