Skip to main content
Get workflow history inside a custom function.
  • Using step_input.get_workflow_history(num_runs=5) we can get the history as a list of tuples.
  • We can also use step_input.get_workflow_history_context(num_runs=5) to get the history as a string.
04_get_history_in_function.py

Usage

1

Create a Python file

Create 04_get_history_in_function.py with the code above.
2

Set up your virtual environment

3

Install dependencies

4

Export your OpenAI API key

5

Run Workflow