Skip to main content
A Step can run a Python function that accepts StepInput and returns StepOutput.
step_with_function.py

Install

Set OpenAI Key

Set your OPENAI_API_KEY as an environment variable. You can get one from OpenAI.

How it works

  1. research_step runs the agent and produces the first step output.
  2. The workflow exposes that output through step_input.previous_step_content.
  3. create_content_plan returns a StepOutput, which becomes the workflow’s final output.

Next steps