get_source_code
Retrieve the exact source code used in a Metaflow run. Get the main flow file or a specific file from the code package by providing the run pathspec.
Instructions
Get the source code from a Metaflow run's code package.
Every Metaflow run that executes remotely stores a snapshot of the code. Use this to inspect the exact code that was used in a run.
Without file_path, returns the main FlowSpec source file and lists all files in the code package. With file_path, returns the content of that specific file from the package.
Args: pathspec: Run pathspec like "FlowName/RunID", or task pathspec like "FlowName/RunID/StepName/TaskID". file_path: Optional path of a specific file within the code package. If omitted, returns the main flow file and a listing of all files in the package.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pathspec | Yes | ||
| file_path | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |