Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ edit the command's Short, Long, Example or flag usage and run `make docs`.
| [`n8n community-package`](n8n_community-package.md) | Manage community node packages |
| [`n8n credential create`](n8n_credential_create.md) | Create a credential from secret JSON |
| [`n8n credential delete`](n8n_credential_delete.md) | Permanently delete a credential |
| [`n8n credential dependencies`](n8n_credential_dependencies.md) | List the workflows and agents that use a credential |
| [`n8n credential get`](n8n_credential_get.md) | Get credential metadata |
| [`n8n credential list`](n8n_credential_list.md) | List credential metadata |
| [`n8n credential schema`](n8n_credential_schema.md) | Show credential data JSON Schema |
Expand Down Expand Up @@ -46,6 +47,7 @@ edit the command's Short, Long, Example or flag usage and run `make docs`.
| [`n8n data-table column`](n8n_data-table_column.md) | Manage the columns of a data table |
| [`n8n data-table create`](n8n_data-table_create.md) | Create a data table |
| [`n8n data-table delete`](n8n_data-table_delete.md) | Permanently delete a data table and every row in it |
| [`n8n data-table dependencies`](n8n_data-table_dependencies.md) | List the workflows that use a data table |
| [`n8n data-table get`](n8n_data-table_get.md) | Show one data table and its columns |
| [`n8n data-table list`](n8n_data-table_list.md) | List data tables |
| [`n8n data-table row clear`](n8n_data-table_row_clear.md) | Permanently delete every row of a data table |
Expand Down Expand Up @@ -229,6 +231,7 @@ edit the command's Short, Long, Example or flag usage and run `make docs`.
| [`n8n workflow archive`](n8n_workflow_archive.md) | Archive a workflow, the reversible soft delete |
| [`n8n workflow create`](n8n_workflow_create.md) | Create a workflow from a definition or as an empty one |
| [`n8n workflow delete`](n8n_workflow_delete.md) | Permanently delete a workflow |
| [`n8n workflow dependencies`](n8n_workflow_dependencies.md) | List what a workflow uses and what uses it |
| [`n8n workflow get`](n8n_workflow_get.md) | Show one workflow with its definition |
| [`n8n workflow history`](n8n_workflow_history.md) | List the saved versions of a workflow |
| [`n8n workflow list`](n8n_workflow_list.md) | List workflows |
Expand Down
1 change: 1 addition & 0 deletions docs/n8n_credential.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ n8n credential [flags]
* [n8n](n8n.md) - Command-line client for the n8n API
* [n8n credential create](n8n_credential_create.md) - Create a credential from secret JSON
* [n8n credential delete](n8n_credential_delete.md) - Permanently delete a credential
* [n8n credential dependencies](n8n_credential_dependencies.md) - List the workflows and agents that use a credential
* [n8n credential get](n8n_credential_get.md) - Get credential metadata
* [n8n credential list](n8n_credential_list.md) - List credential metadata
* [n8n credential schema](n8n_credential_schema.md) - Show credential data JSON Schema
Expand Down
58 changes: 58 additions & 0 deletions docs/n8n_credential_dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
## n8n credential dependencies

List the workflows and agents that use a credential

### Synopsis

List the workflows and agents that use one credential. Check this before
deleting, transferring or rotating a credential. Only metadata is returned;
credential data is never requested. Requires credential:read.

TYPE is the relation to the requested resource:
credential, dataTable, subWorkflow, errorWorkflow
the requested workflow uses this resource
parentWorkflow this workflow uses the requested resource
errorWorkflowParent this workflow uses the requested workflow as its error
workflow
agent this agent uses the requested resource

Dependencies the account in use cannot access are not listed; the summary
counts them as Inaccessible (JSON: inaccessibleCount, over the whole list, not
one page). Pass a returned cursor to --cursor for the next page, or use --all
to follow every cursor, capped at 10,000 dependencies.

With --all, JSON output adds a collection object. Its truncated field is true,
and a warning goes to stderr, when the walk stopped at the 10,000-item limit
without reaching the end. nextCursor then resumes the walk when the limit fell
between pages; it stays empty when the limit fell inside a page, because
resuming from the next page would skip items: narrow the filters or page
explicitly with --limit and --cursor instead.

```
n8n credential dependencies <credential-id> [flags]
```

### Examples

```
n8n credential dependencies CREDENTIAL_ID
n8n credential dependencies CREDENTIAL_ID --all --output json
n8n credential dependencies CREDENTIAL_ID --limit 50 --cursor CURSOR
```

### Options

```
--all follow every page instead of one (maximum 10,000 dependencies; hitting it warns and sets JSON collection.truncated)
--context string saved context name to use (falls back to N8N_CONTEXT, then the saved current context; see 'n8n config context list')
--cursor string pagination cursor returned by a previous page (default: the first page)
-h, --help help for dependencies
--limit int dependencies per API page, 1 to 250 (default: server default of 100)
--output string output format: text or json (JSON is a page object with data, nextCursor and inaccessibleCount, plus collection with --all) (default "text")
--url string instance URL override, e.g. https://n8n.example.com (falls back to N8N_URL, then the selected context URL)
```

### SEE ALSO

* [n8n credential](n8n_credential.md) - Manage node credentials without exposing secrets

1 change: 1 addition & 0 deletions docs/n8n_data-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ n8n data-table [flags]
* [n8n data-table column](n8n_data-table_column.md) - Manage the columns of a data table
* [n8n data-table create](n8n_data-table_create.md) - Create a data table
* [n8n data-table delete](n8n_data-table_delete.md) - Permanently delete a data table and every row in it
* [n8n data-table dependencies](n8n_data-table_dependencies.md) - List the workflows that use a data table
* [n8n data-table get](n8n_data-table_get.md) - Show one data table and its columns
* [n8n data-table list](n8n_data-table_list.md) - List data tables
* [n8n data-table row](n8n_data-table_row.md) - Read and change the rows of a data table
Expand Down
58 changes: 58 additions & 0 deletions docs/n8n_data-table_dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
## n8n data-table dependencies

List the workflows that use a data table

### Synopsis

List the workflows that use one data table. Check this before deleting the
table, clearing its rows or changing its columns. Like every data-table
command it requires API-key authentication, and it requires dataTable:read.

TYPE is the relation to the requested resource:
credential, dataTable, subWorkflow, errorWorkflow
the requested workflow uses this resource
parentWorkflow this workflow uses the requested resource
errorWorkflowParent this workflow uses the requested workflow as its error
workflow
agent this agent uses the requested resource

Dependencies the account in use cannot access are not listed; the summary
counts them as Inaccessible (JSON: inaccessibleCount, over the whole list, not
one page). Pass a returned cursor to --cursor for the next page, or use --all
to follow every cursor, capped at 10,000 dependencies.

With --all, JSON output adds a collection object. Its truncated field is true,
and a warning goes to stderr, when the walk stopped at the 10,000-item limit
without reaching the end. nextCursor then resumes the walk when the limit fell
between pages; it stays empty when the limit fell inside a page, because
resuming from the next page would skip items: narrow the filters or page
explicitly with --limit and --cursor instead.

```
n8n data-table dependencies <table-id> [flags]
```

### Examples

```
n8n data-table dependencies TABLE_ID
n8n data-table dependencies TABLE_ID --all --output json
n8n data-table dependencies TABLE_ID --limit 50 --cursor CURSOR
```

### Options

```
--all follow every page instead of one (maximum 10,000 dependencies; hitting it warns and sets JSON collection.truncated)
--context string saved context name to use (falls back to N8N_CONTEXT, then the saved current context; see 'n8n config context list')
--cursor string pagination cursor returned by a previous page (default: the first page)
-h, --help help for dependencies
--limit int dependencies per API page, 1 to 250 (default: server default of 100)
--output string output format: text or json (JSON is a page object with data, nextCursor and inaccessibleCount, plus collection with --all) (default "text")
--url string instance URL override, e.g. https://n8n.example.com (falls back to N8N_URL, then the selected context URL)
```

### SEE ALSO

* [n8n data-table](n8n_data-table.md) - Manage data tables, their rows and their columns

1 change: 1 addition & 0 deletions docs/n8n_workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ n8n workflow [flags]
* [n8n workflow copy](n8n_workflow_copy.md) - Copy a saved workflow definition from one context to another
* [n8n workflow create](n8n_workflow_create.md) - Create a workflow from a definition or as an empty one
* [n8n workflow delete](n8n_workflow_delete.md) - Permanently delete a workflow
* [n8n workflow dependencies](n8n_workflow_dependencies.md) - List what a workflow uses and what uses it
* [n8n workflow diff](n8n_workflow_diff.md) - Compare saved workflows across two contexts
* [n8n workflow get](n8n_workflow_get.md) - Show one workflow with its definition
* [n8n workflow history](n8n_workflow_history.md) - List the saved versions of a workflow
Expand Down
59 changes: 59 additions & 0 deletions docs/n8n_workflow_dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
## n8n workflow dependencies

List what a workflow uses and what uses it

### Synopsis

List the dependencies of one workflow in both directions: the credentials, data
tables, sub-workflows and error workflow it uses, and the workflows and agents
that use it, as a sub-workflow or as their error workflow. Check this before
archiving, deleting or transferring a workflow. Requires workflow:read.

TYPE is the relation to the requested resource:
credential, dataTable, subWorkflow, errorWorkflow
the requested workflow uses this resource
parentWorkflow this workflow uses the requested resource
errorWorkflowParent this workflow uses the requested workflow as its error
workflow
agent this agent uses the requested resource

Dependencies the account in use cannot access are not listed; the summary
counts them as Inaccessible (JSON: inaccessibleCount, over the whole list, not
one page). Pass a returned cursor to --cursor for the next page, or use --all
to follow every cursor, capped at 10,000 dependencies.

With --all, JSON output adds a collection object. Its truncated field is true,
and a warning goes to stderr, when the walk stopped at the 10,000-item limit
without reaching the end. nextCursor then resumes the walk when the limit fell
between pages; it stays empty when the limit fell inside a page, because
resuming from the next page would skip items: narrow the filters or page
explicitly with --limit and --cursor instead.

```
n8n workflow dependencies <workflow-id> [flags]
```

### Examples

```
n8n workflow dependencies WORKFLOW_ID
n8n workflow dependencies WORKFLOW_ID --all --output json
n8n workflow dependencies WORKFLOW_ID --limit 50 --cursor CURSOR
```

### Options

```
--all follow every page instead of one (maximum 10,000 dependencies; hitting it warns and sets JSON collection.truncated)
--context string saved context name to use (falls back to N8N_CONTEXT, then the saved current context; see 'n8n config context list')
--cursor string pagination cursor returned by a previous page (default: the first page)
-h, --help help for dependencies
--limit int dependencies per API page, 1 to 250 (default: server default of 100)
--output string output format: text or json (JSON is a page object with data, nextCursor and inaccessibleCount, plus collection with --all) (default "text")
--url string instance URL override, e.g. https://n8n.example.com (falls back to N8N_URL, then the selected context URL)
```

### SEE ALSO

* [n8n workflow](n8n_workflow.md) - Manage workflows, their versions and their tags

3 changes: 2 additions & 1 deletion internal/cli/credential.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func newCredentialCommand(opts Options) *cobra.Command {
newCredentialListCommand(opts),
newCredentialCreateCommand(opts),
newCredentialGetCommand(opts),
newCredentialDependenciesCommand(opts),
newCredentialUpdateCommand(opts),
newCredentialDeleteCommand(opts),
newCredentialTestCommand(opts),
Expand Down Expand Up @@ -615,7 +616,7 @@ func credentialScope(action string) scopeNeed {
switch action {
case "list":
return allOf("credential:list")
case "get", "test":
case "get", "test", dependencyAction:
return allOf("credential:read")
case "create":
return allOf("credential:create")
Expand Down
3 changes: 2 additions & 1 deletion internal/cli/datatable.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func newDataTableCommand(opts Options) *cobra.Command {
newDataTableListCommand(opts),
newDataTableCreateCommand(opts),
newDataTableGetCommand(opts),
newDataTableDependenciesCommand(opts),
newDataTableUpdateCommand(opts),
newDataTableDeleteCommand(opts),
newDataTableRowCommand(opts),
Expand Down Expand Up @@ -1561,7 +1562,7 @@ func dataTableScope(action string) scopeNeed {
switch action {
case "list":
return allOf("dataTable:list")
case "read":
case "read", dependencyAction:
return allOf("dataTable:read")
case "create":
return allOf("dataTable:create")
Expand Down
Loading
Loading