<@ULVA73B9P> Where can I find the temp folder crea...
# ask-marvin
e
@Marvin Where can I find the temp folder created during a git clone pull step in the prefect deployment yaml file?
m
thought for 211.8 seconds
Short answer: you won’t find it in the deployment YAML. In Prefect 3.x, the
git_clone
pull step creates a checkout directory at runtime (inside the worker’s process), and returns its path as the step’s output under the key
directory
. That path is not persisted in
prefect.yaml
and there’s no built-in env var for it. How to use/see it: - Give your
git_clone
step an
id
, then reference the path with templating like
{{ <step-id>.directory }}
in later steps (e.g., to set the working directory or to log it). - Example:
Copy code
pull:
  - prefect.deployments.steps.pull.git_clone:
      id: get-code
      repository: <https://github.com/owner/repo.git>
      branch: main

  - prefect.deployments.steps.utility.run_shell_script:
      script: |
        echo "Repo cloned to: {{ get-code.directory }}"

  - prefect.deployments.steps.pull.set_working_directory:
      directory: "{{ get-code.directory }}"
If you want to verify the path from your flow code, you can also log
Path.cwd()
at the start of your flow (after the pull steps run, your working directory will typically be the cloned repo if you set it as above). Docs: - Pull steps, including `git_clone`: prefect.deployments.steps.pull - Prefect YAML reference: prefect.yaml guide If you’re on Prefect 2.x, it’s similar: the temp directory isn’t stored in the YAML; you reference the step output. If you need something different, like cloning into a specific fixed path, let me know your constraints and I can suggest an approach.