> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blinkops.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Copy To Existing Workspace

Copy resources from the selected workspace straight into an existing destination workspace, in one step - no intermediate file. Useful for promoting a Workflow Pack (or an entire workspace) from one environment to another, e.g. re-running a promotion with `update_existing` on.

Leave `resource_types`, `automation_pack_ids`, `workflow_ids`, `agent_pack_ids`, and `agent_ids` empty to copy the whole workspace. Selecting any of them narrows the copy to those resources - each selected resource's dependencies are pulled in automatically.

## Basic Parameters

<div className="integrations-table">
  | Parameter             | Description                                                                                                                                                                                                                                                                                                                            |
  | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | Destination Workspace | Select the existing workspace to copy resources into.                                                                                                                                                                                                                                                                                  |
  | Resource Types        | Select the whole resource types to include in the copy (every instance of that type). Leave empty to not filter by type.<br /><br />**Note**: A type selected here is included in full - `automation_pack_ids`, `workflow_ids`, `agent_pack_ids`, and `agent_ids` have no additional narrowing effect on a type already selected here. |
  | Source Workspace      | Select the workspace to copy resources from.                                                                                                                                                                                                                                                                                           |
</div>

## Advanced Parameters

<div className="integrations-table">
  | Parameter                   | Description                                                                                                                                                                                                                                                                                                                                                                                      |
  | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
  | Agent Packs                 | Select the specific Agent Packs to include in the copy, along with their dependencies. Leave empty to not filter by agent pack.                                                                                                                                                                                                                                                                  |
  | Agents                      | Select the specific Agents to include in the copy, along with their dependencies. Leave empty to not filter by agent.                                                                                                                                                                                                                                                                            |
  | Disable Scheduled Workflows | When checked, copied scheduled workflows are created as inactive instead of running on their configured schedule.                                                                                                                                                                                                                                                                                |
  | Exclude Resource Types      | Select the whole resource types to exclude from the copy.<br /><br />**Note**: A type listed here cannot also be selected via `resource_types`, `automation_pack_ids`, `workflow_ids`, `agent_pack_ids`, or `agent_ids` - and the copy fails, rather than silently dropping the resource, if something selected transitively depends on a resource of an excluded type.                          |
  | Update Existing Resources   | When checked, a resource matching an existing one (by natural key) is updated in place instead of failing on a creation collision.<br /><br />**Note**: Not supported for Tables, Observable Relation Types, Dedup Rules, Extraction Rules, or Investigation Questions - selecting one of those in `resource_types` together with this option fails validation rather than updating it in place. |
  | Workflow Packs              | Select the specific Workflow Packs to include in the copy, along with their dependencies. Leave empty to not filter by pack.                                                                                                                                                                                                                                                                     |
  | Workflows                   | Select the specific workflows to include in the copy, along with their dependencies. Leave empty to not filter by workflow.                                                                                                                                                                                                                                                                      |
</div>

## Example Output

```json theme={"dark"}
{
	"workspace_id": "3f6b9e2a-0000-0000-0000-000000000000",
	"counts": {
		"workflows": 2,
		"automation_packs": 1
	},
	"resources": [
		{
			"type": "automation_packs",
			"path": "workflows/acme-pack/pack.yaml",
			"uuid": "3f6b9e2a-0000-0000-0000-000000000002",
			"name": "acme-pack",
			"outcome": "created"
		},
		{
			"type": "workflows",
			"path": "workflows/wf-a1.yaml",
			"uuid": "3f6b9e2a-0000-0000-0000-000000000001",
			"name": "wf-a1",
			"outcome": "updated"
		},
		{
			"type": "workflows",
			"path": "workflows/wf-a2.yaml",
			"uuid": "3f6b9e2a-0000-0000-0000-000000000003",
			"name": "wf-a2",
			"outcome": "created"
		}
	],
	"warnings": []
}
```
