# StepInput (/reference/workflows/step_input)



| Parameter               | Type                                                         | Description                                                                |
| ----------------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------- |
| `input`                 | `Optional[Union[str, Dict[str, Any], List[Any], BaseModel]]` | Primary input message (can be any format)                                  |
| `previous_step_content` | `Optional[Any]`                                              | Content from the last step                                                 |
| `previous_step_outputs` | `Optional[Dict[str, StepOutput]]`                            | All previous step outputs by name                                          |
| `additional_data`       | `Optional[Dict[str, Any]]`                                   | Additional context data                                                    |
| `images`                | `Optional[List[Image]]`                                      | Media inputs - images (accumulated from workflow input and previous steps) |
| `videos`                | `Optional[List[Video]]`                                      | Media inputs - videos (accumulated from workflow input and previous steps) |
| `audio`                 | `Optional[List[Audio]]`                                      | Media inputs - audio (accumulated from workflow input and previous steps)  |
| `files`                 | `Optional[List[File]]`                                       | File inputs (accumulated from workflow input and previous steps)           |
| `workflow_session`      | `Optional[WorkflowSession]`                                  | The workflow session, used by the workflow history helpers                 |

## Helper Functions [#helper-functions]

| Method                                                         | Return Type             | Description                                                     |
| -------------------------------------------------------------- | ----------------------- | --------------------------------------------------------------- |
| `get_input_as_string()`                                        | `Optional[str]`         | Convert the primary input to a string                           |
| `get_step_output(step_name: str)`                              | `Optional[StepOutput]`  | Get the complete StepOutput object from a specific step by name |
| `get_step_content(step_name: str)`                             | `Optional[Any]`         | Get content from a specific step by name                        |
| `get_all_previous_content()`                                   | `str`                   | Get all previous step content combined                          |
| `get_last_step_content()`                                      | `Optional[Any]`         | Get content from the immediate previous step                    |
| `get_workflow_history(num_runs: Optional[int] = None)`         | `List[Tuple[str, str]]` | Get the workflow history as a list of tuples                    |
| `get_workflow_history_context(num_runs: Optional[int] = None)` | `Optional[str]`         | Get the workflow history as a formatted context string          |
