Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC-1090: Clean up some of the noisiest Vale errors and warnings #2457

Merged
merged 4 commits into from
Sep 10, 2024
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
8 changes: 5 additions & 3 deletions _snippets/integrations/builtin/core-nodes/data-types.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Available data type comparisons

<!-- vale off -->
### String

String data type supports these comparisons:
Expand All @@ -21,7 +21,7 @@ String data type supports these comparisons:

### Number

Numberg data type supports these comparisons:
Number data type supports these comparisons:

- exists
- does not exist
Expand Down Expand Up @@ -86,4 +86,6 @@ Object data type supports these comparisons:
- exists
- does not exist
- is empty
- is not empty
- is not empty

<!-- vale on -->
10 changes: 5 additions & 5 deletions docs/advanced-ai/examples/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ This section provides explanations of important AI concepts, and workflow templa

Learn about agents and chains in AI, including exploring key differences using the example workflow.

[:octicons-arrow-right-24: What is a chain in AI?](/advanced-ai/examples/understand-chains/)
[:octicons-arrow-right-24: What is an agent in AI?](/advanced-ai/examples/understand-agents/)
[:octicons-arrow-right-24: What's a chain in AI?](/advanced-ai/examples/understand-chains/)
[:octicons-arrow-right-24: What's an agent in AI?](/advanced-ai/examples/understand-agents/)
[:octicons-arrow-right-24: Demonstration of key differences between agents and chains](/advanced-ai/examples/agents-vs-chains/)

- __Custom n8n Workflow Tool__

Learn about tools in AI, then explore examples that use n8n workflows as custom tools to give your AI workflow access to more data.

[:octicons-arrow-right-24: What is a tool in AI?](/advanced-ai/examples/understand-tools/)
[:octicons-arrow-right-24: What's a tool in AI?](/advanced-ai/examples/understand-tools/)
[:octicons-arrow-right-24: Chat with Google Sheets](/advanced-ai/examples/data-google-sheets/)
[:octicons-arrow-right-24: Call an API to fetch data](/advanced-ai/examples/api-workflow-tool/)
[:octicons-arrow-right-24: Set up a human fallback](/advanced-ai/examples/human-fallback/)
Expand All @@ -34,14 +34,14 @@ This section provides explanations of important AI concepts, and workflow templa

Learn about vector databases in AI, along with related concepts including embeddings and retrievers.

[:octicons-arrow-right-24: What is a vector database?](/advanced-ai/examples/understand-vector-databases/)
[:octicons-arrow-right-24: What's a vector database?](/advanced-ai/examples/understand-vector-databases/)
[:octicons-arrow-right-24: Populate a Pinecone vector database from a website](/advanced-ai/examples/vector-store-website/)

- __Memory__

Learn about memory in AI.

[:octicons-arrow-right-24: What is memory in AI?](/advanced-ai/examples/understand-memory/)
[:octicons-arrow-right-24: What's memory in AI?](/advanced-ai/examples/understand-memory/)

- __AI workflow templates__

Expand Down
4 changes: 2 additions & 2 deletions docs/advanced-ai/examples/understand-agents.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
#https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
title: What is an agent in AI?
title: What's an agent in AI?
description: Understand agents in the context of AI. Learn how n8n provides agents.
contentType: explanation
---

# What is an agent in AI?
# What's an agent in AI?

One way to think of an agent is as a [chain](/advanced-ai/examples/understand-chains/) that knows how to make decisions. Where a chain follows a predetermined sequence of calls to different AI components, an agent uses a language model to determine which actions to take.

Expand Down
4 changes: 2 additions & 2 deletions docs/advanced-ai/examples/understand-chains.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
#https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
title: What is a chain in AI?
title: What's a chain in AI?
description: Understand chains in the context of AI. Learn about chains in n8n.
contentType: explanation
---

# What is a chain in AI?
# What's a chain in AI?

Chains bring together different components of AI to create a cohesive system. They set up a sequence of calls between the components. These components can include models and memory (though note that in n8n chains can't use memory).

Expand Down
4 changes: 2 additions & 2 deletions docs/advanced-ai/examples/understand-memory.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
#https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
title: What is memory in AI?
title: What's memory in AI?
description: Understand memory in the context of AI. Learn what's special about memory in n8n.
contentType: explanation
---

# What is memory in AI?
# What's memory in AI?

Memory is a key part of AI chat services. The memory keeps a history of previous messages, allowing for an ongoing conversation with the AI, rather than every interaction starting fresh.

Expand Down
4 changes: 2 additions & 2 deletions docs/advanced-ai/examples/understand-tools.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
#https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
title: What is a tool in AI?
title: What's a tool in AI?
description: Understand tools in the context of AI. Learn what's special about tools in n8n.
contentType: explanation
---

# What is a tool in AI?
# What's a tool in AI?

In AI, 'tools' has a specific meaning. Tools act like addons that your AI can use to access extra context or resources.

Expand Down
68 changes: 36 additions & 32 deletions docs/embed/configuration.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
#https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
title: n8n Embed Configuration
description: Learn how to configure your n8n Embed.
contentType: howto
---

Expand All @@ -23,7 +25,7 @@

#### Using environment variables

Credential overwrites can be set using environment variable by setting the `CREDENTIALS_OVERWRITE_DATA` to `{ CREDENTIAL_NAME: { PARAMETER: VALUE }}`.
You can set credential overwrites using environment variable by setting the `CREDENTIALS_OVERWRITE_DATA` to `{ CREDENTIAL_NAME: { PARAMETER: VALUE }}`.

/// warning
Even though this is possible, it isn't recommended. Environment variables aren't protected in n8n, so the data can leak to users.
Expand Down Expand Up @@ -68,12 +70,12 @@

/// note
There are cases when credentials are based on others. For example, the `googleSheetsOAuth2Api` extends the `googleOAuth2Api`.
In this case, you can set parameters on the parent credentials (`googleOAuth2Api`) which will be used by all child-credentials (`googleSheetsOAuth2Api`).
In this case, you can set parameters on the parent credentials (`googleOAuth2Api`) for all child-credentials (`googleSheetsOAuth2Api`) to use.
///

## Environment variables

There are many [environment variables configurable in n8n](https://docs.n8n.io/reference/environment-variables.html). The following are most relevant for your hosted solution:
n8n has many [environment variables](/reference/environment-variables/) you can configure. Here are the most relevant environment variables for your hosted solution:

Check warning on line 78 in docs/embed/configuration.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [from-write-good.Weasel] 'many' is a weasel word! Raw Output: {"message": "[from-write-good.Weasel] 'many' is a weasel word!", "location": {"path": "docs/embed/configuration.md", "range": {"start": {"line": 78, "column": 9}}}, "severity": "WARNING"}

| Variable | Type | Default | Description |
| :------- | :--- | :------ | :---------- |
Expand All @@ -94,37 +96,37 @@

| Hook | Arguments | Description |
| :------- | :---------| :---------- |
| `credentials.create` | `[credentialData: ICredentialsDb]` | Called before new credentials get created. Can be used to restrict the number of credentials. |
| `credentials.create` | `[credentialData: ICredentialsDb]` | Called before new credentials get created. Use to restrict the number of credentials. |
| `credentials.delete` | `[id: credentialId]` | Called before credentials get deleted. |
| `credentials.update` | `[credentialData: ICredentialsDb]` | Called before existing credentials are saved. |
| `frontend.settings` | `[frontendSettings: IN8nUISettings]` | Gets called on n8n startup. Allows you to, for example, overwrite frontend data like the displayed OAuth URL. |
| `n8n.ready` | `[app: App]` | Called once n8n is ready. Can be used to, for example, register custom API endpoints. |
| `n8n.ready` | `[app: App]` | Called once n8n is ready. Use to, for example, register custom API endpoints. |
| `n8n.stop` | | Called when an n8n process gets stopped. Allows you to save some process data. |
| `oauth1.authenticate` | `[oAuthOptions: clientOAuth1.Options, oauthRequestData: {oauth_callback: string}]` | Called before an OAuth1 authentication. Can be used to overwrite an OAuth callback URL. |
| `oauth2.callback` | `[oAuth2Parameters: {clientId: string, clientSecret: string \| undefined, accessTokenUri: string, authorizationUri: string, redirectUri: string, scopes: string[]}]` | Called in an OAuth2 callback. Can be used to overwrite an OAuth callback URL. |
| `workflow.activate` | `[workflowData: IWorkflowDb]` | Called before a workflow gets activated. Can be used to restrict the number of active workflows. |
| `oauth1.authenticate` | `[oAuthOptions: clientOAuth1.Options, oauthRequestData: {oauth_callback: string}]` | Called before an OAuth1 authentication. Use to overwrite an OAuth callback URL. |
| `oauth2.callback` | `[oAuth2Parameters: {clientId: string, clientSecret: string \| undefined, accessTokenUri: string, authorizationUri: string, redirectUri: string, scopes: string[]}]` | Called in an OAuth2 callback. Use to overwrite an OAuth callback URL. |
| `workflow.activate` | `[workflowData: IWorkflowDb]` | Called before a workflow gets activated. Use to restrict the number of active workflows. |
| `workflow.afterDelete` | `[workflowId: string]` | Called after a workflow gets deleted. |
| `workflow.afterUpdate` | `[workflowData: IWorkflowBase]` | Called after an existing workflow gets saved. |
| `workflow.create` | `[workflowData: IWorkflowBase]` | Called before a workflow gets created. Can be used to restrict the number of saved workflows. |
| `workflow.create` | `[workflowData: IWorkflowBase]` | Called before a workflow gets created. Use to restrict the number of saved workflows. |
| `workflow.delete` | `[workflowId: string]` | Called before a workflow gets delete. |
| `workflow.postExecute` | `[run: IRun, workflowData: IWorkflowBase]` | Called after a workflow gets executed. |
| `workflow.preExecute` | `[workflow: Workflow: mode: WorkflowExecuteMode]` | Called before a workflow gets executed. Allows you to count or limit the number of workflow executions. |
| `workflow.update` | `[workflowData: IWorkflowBase]` | Called before an existing workflow gets saved. |

### Registering hooks

Hooks are set by registering a hook file that contains the hook functions.
Hook registration is done using the environment variable `EXTERNAL_HOOK_FILES`.
Set hooks by registering a hook file that contains the hook functions.
To register a hook, set the environment variable `EXTERNAL_HOOK_FILES`.

The variable can be set to a single file:
You can set the variable to a single file:

`EXTERNAL_HOOK_FILES=/data/hook.js`

Or to contain multiple files separated by a semicolon:

`EXTERNAL_HOOK_FILES=/data/hook1.js;/data/hook2.js`

### Hook files
### Backend hook files

Hook files are regular JavaScript files that have the following format:

Expand Down Expand Up @@ -154,31 +156,33 @@
}
```

### Hook functions
### Backend hook functions

A hook or a hook file can contain multiple hook functions, with all functions executed one after another.

If the parameters of the hook function are objects, it's possible to change the data of that parameter to change the behavior of n8n.
Additionally, the database can also be accessed in any hook function using `this.dbCollections` (see above).

You can also access the database in any hook function using `this.dbCollections` (refer to the code sample in [Backend hook files](#backend-hook-files).

## Frontend external hooks

Like backend external hooks, it's possible to define external hooks in the frontend code that get executed by n8n whenever a specific operation is performed. They can be used, for example, to log data and change data.
Like backend external hooks, it's possible to define external hooks in the frontend code that get executed by n8n whenever a user performs a specific operation. You can use them, for example, to log data and change data.

### Available hooks

| Hook | Description |
| :------- | :---------- |
| `credentialsEdit.credentialTypeChanged` | Called when an existing credential's type is changed. |
| `credentials.create` | Called when a new credential is created. |
| `credentialsEdit.credentialTypeChanged` | Called when an existing credential's type changes. |
| `credentials.create` | Called when someone creates a new credential. |
| `credentialsList.dialogVisibleChanged` | |
| `dataDisplay.nodeTypeChanged` | |
| `dataDisplay.onDocumentationUrlClick` | Called when the help documentation link is selected. |
| `execution.open` | Called when an existing execution is opened. |
| `executionsList.openDialog` | Called when the an execution is selected from existing Workflow Executions. |
| `dataDisplay.onDocumentationUrlClick` | Called when someone selects the help documentation link. |
| `execution.open` | Called when an existing execution opens. |
| `executionsList.openDialog` | Called when someone selects an execution from existing Workflow Executions. |
| `expressionEdit.itemSelected` | |
| `expressionEdit.dialogVisibleChanged` | |
| `nodeCreateList.filteredNodeTypesComputed` | |
| `nodeCreateList.nodeFilterChanged` | Called when a new entry has been made in the node panel filter. |
| `nodeCreateList.nodeFilterChanged` | Called when someone makes any changes to the node panel filter. |
| `nodeCreateList.selectedTypeChanged` | |
| `nodeCreateList.mounted` | |
| `nodeCreateList.destroyed` | |
Expand All @@ -193,24 +197,24 @@
| `runData.displayModeChanged` | |
| `workflow.activeChange` | |
| `workflow.activeChangeCurrent` | |
| `workflow.afterUpdate` | Called when an existing workflow is updated. |
| `workflow.afterUpdate` | Called when someone updates an existing workflow. |
| `workflow.open` | |
| `workflowRun.runError` | |
| `workflowRun.runWorkflow` | Called when a workflow is executed. |
| `workflowRun.runWorkflow` | Called when a workflow executes. |
| `workflowSettings.dialogVisibleChanged` | |
| `workflowSettings.saveSettings` | Called when the settings of a workflow are saved. |
| `workflowSettings.saveSettings` | Called when someone saves the settings of a workflow. |

### Registering hooks

Hooks can be set by loading the hooks script on the page. One way to do this is by creating a hooks file in the project and adding a script tag in your `editor-ui/public/index.html` file:
You can set hooks by loading the hooks script on the page. One way to do this is by creating a hooks file in the project and adding a script tag in your `editor-ui/public/index.html` file:

```html
<script src="frontend-hooks.js"></script>
```

### Hook files
### Frontend hook files

Hook files are regular JavaScript files which have the following format:
Frontend external hook files are regular JavaScript files which have the following format:

```js
window.n8nExternalHooks = {
Expand All @@ -237,9 +241,9 @@
};
```

### Hook functions
### Frontend hook functions

Multiple hook functions can be defined per hook. Each hook function is invoked with the following arguments arguments:
You can define multiple hook functions per hook. Each hook function is invoked with the following arguments arguments:

Check warning on line 246 in docs/embed/configuration.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [from-write-good.Passive] 'is invoked' may be passive voice. Use active voice if you can. Raw Output: {"message": "[from-write-good.Passive] 'is invoked' may be passive voice. Use active voice if you can.", "location": {"path": "docs/embed/configuration.md", "range": {"start": {"line": 246, "column": 69}}}, "severity": "WARNING"}

* `store`: The Vuex store object. Can be used to change or get data from the store.
* `metadata`: Object that contains any data provided by the hook. To see exactly what's passed, search for the hook in the `editor-ui` package.
* `store`: The Vuex store object. You can use this to change or get data from the store.
* `metadata`: The object that contains any data provided by the hook. To see what's passed, search for the hook in the `editor-ui` package.
4 changes: 2 additions & 2 deletions docs/integrations/builtin/credentials/contentful.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ Refer to [Contentful's API documentation](https://www.contentful.com/developers/
To configure this credential, you'll need:

- Your Contentful **Space ID**: The Space ID displays as you generate the tokens; You can also refer to the [Contentful Find space ID documentation](https://www.contentful.com/help/find-space-id/){:target=_blank .external-link} to view the Space ID.
- A **Content Delivery API Access Token**: Required if you want to use the [Content Delivery API](https://www.contentful.com/developers/docs/references/content-delivery-api/){:target=_blank .external-link}. Leave blank if you do not intend to use this API.
- A **Content Preview API Access Token**: Required if you want to use the [Content Preview API](https://www.contentful.com/developers/docs/references/content-preview-api/){:target=_blank .external-link}. Leave blank if you do not intend to use this API.
- A **Content Delivery API Access Token**: Required if you want to use the [Content Delivery API](https://www.contentful.com/developers/docs/references/content-delivery-api/){:target=_blank .external-link}. Leave blank if you don't intend to use this API.
- A **Content Preview API Access Token**: Required if you want to use the [Content Preview API](https://www.contentful.com/developers/docs/references/content-preview-api/){:target=_blank .external-link}. Leave blank if you don't intend to use this API.

View and generate access tokens in Contentful in **Settings > API keys**. Contentful generates tokens for both Content Delivery API and Content Preview API as part of a single key. Refer to [Contentful Creating and managing API keys](https://training.contentful.com/student/activity/1050378-creating-and-managing-api-keys){:target=_blank .external-link} for detailed instructions.

6 changes: 3 additions & 3 deletions docs/integrations/builtin/credentials/formstacktrigger.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Once you've created the application, copy the access token either from the appli
Refer to [Formstack's API Authorization documentation](https://developers.formstack.com/reference/api-overview#obtaining-an-api-key-oauth2-access-token){:target=_blank .external-link} for more detailed instructions.

/// note | Access token permissions
Access tokens are tied to a Formstack user and follow Formstack (in-app) user permissions.
Formstack ties access tokens to a Formstack user. Access tokens follow Formstack (in-app) user permissions.
///

## Using OAuth2
Expand All @@ -54,11 +54,11 @@ To generate both of these, [create a new application](https://www.formstack.com/
- For self-hosted n8n instances, enter the OAuth callback URL for your n8n instance in the format `https://<n8n_url>/rest/oauth2-credential/callback`. For example `https://localhost:5678/rest/oauth2-credential/callback`.
- **Platform**: Select **Website**.

Once you've created the application, select it from the applications list to view the **Application Details**. Copy the **Client ID** and **Client Secret** and add them to n8n. Once you've added both, select the **Connect my account** button to initiate the OAuth2 flow and authorization process.
Once you've created the application, select it from the applications list to view the **Application Details**. Copy the **Client ID** and **Client Secret** and add them to n8n. Once you've added both, select the **Connect my account** button to begin the OAuth2 flow and authorization process.

Refer to [Formstack's API Authorization documentation](https://developers.formstack.com/reference/api-overview#obtaining-an-api-key-oauth2-access-token){:target=_blank .external-link} for more detailed instructions.

/// note | Access token permissions
Access tokens are tied to a Formstack user and follow Formstack (in-app) user permissions.
Formstack ties access tokens to a Formstack user. Access tokens follow Formstack (in-app) user permissions.
///

Loading
Loading