Terraform Cloud icon

Terraform Cloud

Interact with the Terraform Cloud API

Workspace → Get Workspace State

AI-generated

Summary

Fetches the latest state version metadata and download URL for a Terraform Cloud workspace identified either by workspace ID or by organization and workspace name.

Inputs

  • Workspace ID (required) — The unique identifier of the workspace to fetch state metadata for. Required if not resolving workspace by name.
  • Resolve Workspace by Name — Set to true to identify the workspace by organization and workspace name instead of workspace ID.
  • Workspace Name (required) — The slug name of the workspace within the specified organization. Required when resolving by name.
  • Organization (required) — The Terraform Cloud organization name that owns the workspace. Required when resolving by name.

Output shape

a single JSON object containing workspaceId, stateVersionId, downloadUrl, and detailed stateVersion metadata

If resolving by name, the node first retrieves the workspace ID. Throws an error if the workspace has no current state version. The output includes the URL to download the latest state file.

Examples

Example 1: Get workspace state by workspace ID

Provide the Workspace ID and select the Get Workspace State operation without enabling resolve by name.

Example 2: Get workspace state by organization and workspace name

Enable Resolve Workspace by Name, provide the Organization and Workspace Name, and select the Get Workspace State operation.

Links

Discussion