medusajs/medusa · error

Config is not available for the input object.

Error message

Config is not available for the input object.

What it means

In Medusa's workflow composer, the workflow input is a proxy placeholder. Calling .config() on the input proxy throws by design because the raw input object carries no configuration; config() is only meaningful on step outputs inside the composer. This guard prevents developers from reading configuration that does not exist yet.

Source

Thrown at packages/core/workflows-sdk/src/utils/composer/create-workflow.ts:166

      context.hooks_.declared.push(name)
      context.hooksCallback_[name] = fn.bind(context)()
    },
    stepBinder: (fn) => {
      return fn.bind(context)()
    },
    parallelizeBinder: (fn) => {
      return fn.bind(context)()
    },
  }

  global[OrchestrationUtils.SymbolMedusaWorkflowComposerContext] = context

  const inputPlaceHolder = proxify<WorkflowData>({
    __type: OrchestrationUtils.SymbolInputReference,
    __step__: "",
    config: () => {
      // TODO: config default value?
      throw new Error("Config is not available for the input object.")
    },
  })

  const returnedStep = composer.apply(context, [inputPlaceHolder])

  delete global[OrchestrationUtils.SymbolMedusaWorkflowComposerContext]

  if (newWorkflow) {
    WorkflowManager.update(name, context.flow, handlers, options)
  } else {
    WorkflowManager.register(name, context.flow, handlers, options)
  }

  const workflow = exportWorkflow<TData, TResult>(name, returnedStep, {
    wrappedInput: true,
    sourcePath: fileSourcePath,
  })

View on GitHub (pinned to 5e06e544a2)

Solutions

  1. Remove the input.config() call; configuration belongs on the workflow runner (workflow.run({ input, config })) or on steps, not on the input proxy
  2. If you need conditional behavior based on options, pass them through the input itself and read them via transform()
  3. Check the version of @medusajs/workflows-sdk you use and align with its composer docs

Example fix

// before
createWorkflow("w", (input) => { input.config() /* throws */ })

// after
createWorkflow("w", (input) => { someStep(input) })
// config goes to the runner: myWorkflow(req.scope).run({ input, config: { retry: 2 } })
Defensive patterns

Strategy: validation

Validate before calling

// Pass options through input, not input.config()
await myWorkflow(container).run({
  input: { orderId, notify: true },
  config: { retry: 2 }, // runner-level config is valid
})

Type guard

null

Try / catch

null

Prevention

When it happens

Trigger: Calling input.config() inside a createWorkflow callback where input is the WorkflowData placeholder; accessing config on the proxified input reference (SymbolInputReference proxy).

Common situations: Assuming WorkflowData has a fluent config API like step outputs do; porting code from an older workflows-sdk version where config behaved differently; IntelliSense autocompletion selecting config() on the input proxy.

Related errors


AI-assisted analysis of medusajs/medusa@5e06e544a2 (2026-08-27). Data as JSON: /api/errors/dd7b3f4da029f30c. Report an issue: GitHub.