## TL;DR
A Jenkins secret file binding does not drop the file into the workspace; it creates a temporary file and hands you its path in a variable. Reference that variable's path in your build steps instead of a workspace-relative path. The file is there, just not where you looked.

## Error
```text
jenkins secret file binding: file not found in workspace
```

## Steps
1. Inspect the binding: in the `withCredentials` (or declarative `credentials`) block, note the variable name assigned to the file binding. Expected: you know which variable holds the temp path.
2. Use the variable as the path: pass the variable itself (for example as an argument to your tool) rather than constructing a workspace path. Expected: the tool reads the temporary file successfully.
3. Debug by printing the variable's value (the path, never the file contents) in a test build. Expected: a temp path outside the workspace, confirming the mental model.
4. Remember the file is ephemeral: it exists only for the duration of the `withCredentials` block. Expected: no build step outside the block references it.
5. For declarative pipelines, use the `credentials` binding helper with the file type and reference the generated variable the same way. Expected: identical behavior in declarative syntax.

## When to use
- Build steps fail with "file not found" for a Jenkins secret file binding
- Migrating from workspace-checked-in files to credential bindings
- Debugging where Jenkins puts bound files

## When not to use
- "No credentials found with id" (the credential itself is missing)
- The file binds but its contents are wrong (update the credential)

## Tool compatibility
- Jenkins credentials binding plugin; scripted and declarative pipelines

## Variant phrasings
### withcredentials file variable path
The variable holds an absolute temp path; treat it as opaque and pass it straight to your tool.

### jenkins secret file disappears after block
The binding cleans up the temp file when the block exits; copy it inside the block if a later stage needs it.

## Why it happens
Jenkins materializes secret files into a secured temporary directory to keep them out of the workspace (which gets archived, cached, and copied). The indirection is a security feature, but it breaks any step that assumes workspace-relative paths.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_R5_ALU8zc-o5Vt8YfLcF8A
