Skip to content

Conversation

@mortyyy1
Copy link

This is almost ready part of Dify documentation only without OAuth part. It's still in process...

@mortyyy1 mortyyy1 requested a review from TC-MO as a code owner October 22, 2025 14:56
@drobnikj drobnikj self-requested a review October 23, 2025 11:23
Copy link
Contributor

@TC-MO TC-MO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rephrased a lot of lists to prose. We should not rely as heavily on unorderd or ordered lists to explain workflows to users.
Fixed admonition to use docusaurus syntax
Added title to code example

Apart from that few questions about the example ID's used & question regarding the Troubleshooting section


[Dify](https://dify.ai/) is an intuitive LLM application development platform for creating and operating AI-native apps. With the Apify integration for Dify, you can connect Apify Actors and storage to your Dify Workflows and Chatflows. You can run scrapers, extract data, and trigger workflows based on Apify events.

In this guide, you'll learn how to set up authentication and incorporate the Apify plugin into your Dify applications as either a tool (action) or a trigger.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In this guide, you'll learn how to set up authentication and incorporate the Apify plugin into your Dify applications as either a tool (action) or a trigger.
This guide explains how to set up authentication and incorporate the Apify plugin into your Dify applications as either a tool (action) or a trigger.

Comment on lines +28 to +34
1. In Dify, navigate to **Plugins** from the top menu.
2. Click on the **Install plugin → Marketplace**
3. Find the **apify-integration** plugin and install it.
4. Return back to the **Plugins** page. There will be our plugin.
6. Open the plugin window and click on the **Add API Key**.
5. In the pop-up menu, paste your Apify API token. You can find it in the [Apify Console](https://console.apify.com/settings/integrations).
4. Click **Save**.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. In Dify, navigate to **Plugins** from the top menu.
2. Click on the **Install plugin → Marketplace**
3. Find the **apify-integration** plugin and install it.
4. Return back to the **Plugins** page. There will be our plugin.
6. Open the plugin window and click on the **Add API Key**.
5. In the pop-up menu, paste your Apify API token. You can find it in the [Apify Console](https://console.apify.com/settings/integrations).
4. Click **Save**.
1. In Dify, navigate to **Plugins** from the top menu.
1. Select on the **Install plugin → Marketplace**
1. Find the **apify-integration** plugin and install it.
1. Return to the **Plugins** page.
1. Open the plugin window and select **Add API Key**.
1. In the pop-up menu, paste your Apify API token. You can find it in the [Apify Console](https://console.apify.com/settings/integrations).
1. Select **Save**.


![Apify Auth in Dify](../images/dify-connection-popup.png)

A green indicator light confirms that your credentials are correct.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A green indicator light confirms that your credentials are correct.
A green indicator confirms that your credentials.


With authentication set up, you can now add Apify tools to your applications.

## Using Apify Tools in a Workflow
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Using Apify Tools in a Workflow
## Use Apify Tools in a Workflow

Comment on lines +46 to +50
Start by creating a workflow in Dify, then add Apify tools to handle tasks like running Actors or fetching data.

1. In the Dify Studio, create a new **Workflow** application.
2. Choose **Create from Blank**.
3. Click the **+** icon on the **Start** node and select an Apify tool to add it to your board.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Start by creating a workflow in Dify, then add Apify tools to handle tasks like running Actors or fetching data.
1. In the Dify Studio, create a new **Workflow** application.
2. Choose **Create from Blank**.
3. Click the **+** icon on the **Start** node and select an Apify tool to add it to your board.
Create a new **Workflow** application in Dify Studio and choose **Create from Blank**. Select the **+** icon on the **Start** node and choose an Apify tool to add it to your board.

Comment on lines +105 to +110
1. Add the **Get Dataset Items** tool.
2. Enter the **Dataset ID** to retrieve items from. (e.g., `58S2Um7hSXWYghZhn`)
3. Add an **End** node and map its output to the tool's `json` result.

![Get Dataset Items Node](../images/dify-dataset-input.png)
![Get Dataset Items Node](../images/dify-dataset-succeded.png)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we even give an example Dataset ID here? Or is this just a random string?

Suggested change
1. Add the **Get Dataset Items** tool.
2. Enter the **Dataset ID** to retrieve items from. (e.g., `58S2Um7hSXWYghZhn`)
3. Add an **End** node and map its output to the tool's `json` result.
![Get Dataset Items Node](../images/dify-dataset-input.png)
![Get Dataset Items Node](../images/dify-dataset-succeded.png)
Add the **Get Dataset Items** tool and enter the **Dataset ID** to retrieve items from (for example, `58S2Um7hSXWYghZhn`). Add an **End** node and map its output to the tool's `json` result.
![Get Dataset Items Node](../images/dify-dataset-input.png)
![Get Dataset Items Node](../images/dify-dataset-succeded.png)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the Get Dataset Items tool and enter the Dataset ID to retrieve items from (for example, 58S2Um7hSXWYghZhn)

Let's update the example instead of hardcode dataset ID let's take it from previous step which could be Run an Actor or trigger

Comment on lines +114 to +119
1. Add the **Get Key-Value Store** tool.
2. Enter the **Store ID** and **Key** for the record you want to retrieve. (e.g., Store ID `fC0qZmL5RWIxoJG8z`, Record Key `INPUT`)
3. Add an **End** node and map its output to the tool's `json` result.

![Get Key-Value Store Node](../images/dify-key-value-input.png)
![Get Key-Value Store Node](../images/dify-key-value-succeded.png)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question about Store ID as for Dataset & Task?

Suggested change
1. Add the **Get Key-Value Store** tool.
2. Enter the **Store ID** and **Key** for the record you want to retrieve. (e.g., Store ID `fC0qZmL5RWIxoJG8z`, Record Key `INPUT`)
3. Add an **End** node and map its output to the tool's `json` result.
![Get Key-Value Store Node](../images/dify-key-value-input.png)
![Get Key-Value Store Node](../images/dify-key-value-succeded.png)
Add the **Get Key-Value Store** tool and enter the **Store ID** and **Key** for the record you want to retrieve (for example, Store ID `fC0qZmL5RWIxoJG8z`, Record Key `INPUT`). Add an **End** node and map its output to the tool's `json` result.
![Get Key-Value Store Node](../images/dify-key-value-input.png)
![Get Key-Value Store Node](../images/dify-key-value-succeded.png)

Comment on lines +179 to +183
## Troubleshooting

- Ensure your JSON inputs in fields are valid and properly formatted.

If you have any questions or need help, feel free to reach out to us on our [developer community on Discord](https://discord.com/invite/jyEM2PRvMU).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels extremely obvious & redundant. I would remove whole section as it brings little value. Also not sure if giving a discord link here is good practice since we are talking about 3rd party integration? Thoughts @drobnikj ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree the Troubleshooting section is not necessary there I would keep link to discord as we have it also in other integrations docs.

Maybe I would be nice to have this as some reusable block and put it in every integrations docs end. Currently if we want to change this section we would need to update it across all integrations.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can achieve this, though it would reduce the readability of raw markdown files. Docusaurus supports importing markdown as components, which could work here.

However, the linked discussion raises a broader question: We already display the Discord link/icon in the top navigation. For third-party integrations, where we have limited control, should we really be directing users to our community for support? This approach might set incorrect expectations about what kind of help they can receive.

Comment on lines +160 to +177
### Accessing Apify Data in Dify
When an event in Apify triggers your Dify endpoint, Apify sends a detailed nested response [JSON object](https://docs.apify.com/api/v2/act-runs-post#responses) containing information about the event. We can use this data to power our workflow.

Dify cannot directly use nested syntax like `resource.id` in its variable system. Instead, it requires you to access nested properties using a flattened format (`resource__id`), where each level of nesting is represented by a double underscore (`__`).

To work with a nested property in your workflow, you must first define it as an input variable in your workflow's Start node by clicking `+`.

![Chatflow Payload Template](../images/dify-workflow-input-variable.png)

![Chatflow Payload Template](../images/dify-define-input-variable.png)

![Chatflow Payload Template](../images/dify-workflow-with-input-variable.png)

We can also use that variable inside a JSON object we send and see the results.

![Chatflow Payload Template](../images/dify-input-variable-webhook.png)

![Chatflow Payload Template](../images/dify-input-variable-webhook-succeded.png)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Accessing Apify Data in Dify
When an event in Apify triggers your Dify endpoint, Apify sends a detailed nested response [JSON object](https://docs.apify.com/api/v2/act-runs-post#responses) containing information about the event. We can use this data to power our workflow.
Dify cannot directly use nested syntax like `resource.id` in its variable system. Instead, it requires you to access nested properties using a flattened format (`resource__id`), where each level of nesting is represented by a double underscore (`__`).
To work with a nested property in your workflow, you must first define it as an input variable in your workflow's Start node by clicking `+`.
![Chatflow Payload Template](../images/dify-workflow-input-variable.png)
![Chatflow Payload Template](../images/dify-define-input-variable.png)
![Chatflow Payload Template](../images/dify-workflow-with-input-variable.png)
We can also use that variable inside a JSON object we send and see the results.
![Chatflow Payload Template](../images/dify-input-variable-webhook.png)
![Chatflow Payload Template](../images/dify-input-variable-webhook-succeded.png)
### Access Apify Data in Dify
When an event in Apify triggers your Dify endpoint, Apify sends a detailed [JSON response object](https://docs.apify.com/api/v2/act-runs-post#responses) containing information about the event. You can use this data to power your workflow.
Dify cannot directly use nested syntax like `resource.id` in its variable system. Instead, access nested properties using a flattened format (`resource__id`), where each level of nesting is represented by a double underscore (`__`).
To work with a nested property in your workflow, define it as an input variable in your workflow's Start node by selecting **+**.
![Chatflow Payload Template](../images/dify-workflow-input-variable.png)
![Chatflow Payload Template](../images/dify-define-input-variable.png)
![Chatflow Payload Template](../images/dify-workflow-with-input-variable.png)
You can also use that variable inside a JSON object you send and view the results.
![Chatflow Payload Template](../images/dify-input-variable-webhook.png)
![Chatflow Payload Template](../images/dify-input-variable-webhook-succeded.png)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Section

Accessing Apify Data in Dify

is little bit confusing, honestly after reading I'm still not sure how to do it. Can you try to explain it better, maybe add some refenrence to difi docs about nested fields? (if they have any)
Plus also help if you use some real word use case, like using defaultDatasetId to download data from triggered run.

Comment on lines +121 to +158
## Use Apify as a trigger

Triggers let your Dify application respond automatically to events in Apify, such as when an Actor run finishes. This is ideal for creating event-driven automations.

1. In your Dify app, go to **Overview** > **Endpoints**.
2. Click the **+** icon to create a new endpoint.
3. Select the **Workflow** or **Chatflow** application you want to trigger and give it a name.
4. **Save** the endpoint. Dify will generate two URLs.

![Create Dify Endpoint](../images/dify-workflow-input.png)
![Create Dify Endpoint](../images/dify-trigger-url.png)

5. Copy the URL that corresponds to your application type (Workflow or Chatflow).
6. In the Apify Console, open the Actor you want to use as a trigger.
7. Go to the **Integrations** tab and select the **HTTP webhook** option.
8. Paste the Dify endpoint URL.
9. Under **Events**, select **Run succeeded**.
10. **Save** the integration.

![Create Dify Endpoint](../images/dify-trigger-webhook.png)
![Create Dify Endpoint](../images/dify-trigger-apify-console.png)

> **IMPORTANT: Publish Required**
> A Dify Workflow or Chatflow **must be published** for the webhook trigger to work. If the application is not published, the webhook will fail.
> ![Create Dify Endpoint](../images/dify-workflow-publish.png)

To confirm that your webhook is working, you can create a simple workflow that catches the incoming data from Apify and sends it to a third-party request catcher like [Webhook.site](https://webhook.site/). This provides an easy way to inspect the data we send.
![Create Dify Endpoint](../images/dify-trigger-workflow.png)

Now we can start the Actor in the Apify Console and it will trigger our workflow.

![Create Dify Endpoint](../images/dify-trigger-succeded.png)

The setup for a Chatflow is nearly the same. The only differences are to select your Chatflow app instead of a Workflow and to copy the specific Chatflow endpoint URL.

> **Chatflow Trigger Requirement**
> Also, when triggering a **Chatflow**, you **must** provide a **Payload template** in the Apify webhook settings. This template needs a `query` field to serve as the first message to the chatflow.
> ![Chatflow Payload Template](../images/dify-trigger-query.png)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Use Apify as a trigger
Triggers let your Dify application respond automatically to events in Apify, such as when an Actor run finishes. This is ideal for creating event-driven automations.
1. In your Dify app, go to **Overview** > **Endpoints**.
2. Click the **+** icon to create a new endpoint.
3. Select the **Workflow** or **Chatflow** application you want to trigger and give it a name.
4. **Save** the endpoint. Dify will generate two URLs.
![Create Dify Endpoint](../images/dify-workflow-input.png)
![Create Dify Endpoint](../images/dify-trigger-url.png)
5. Copy the URL that corresponds to your application type (Workflow or Chatflow).
6. In the Apify Console, open the Actor you want to use as a trigger.
7. Go to the **Integrations** tab and select the **HTTP webhook** option.
8. Paste the Dify endpoint URL.
9. Under **Events**, select **Run succeeded**.
10. **Save** the integration.
![Create Dify Endpoint](../images/dify-trigger-webhook.png)
![Create Dify Endpoint](../images/dify-trigger-apify-console.png)
> **IMPORTANT: Publish Required**
> A Dify Workflow or Chatflow **must be published** for the webhook trigger to work. If the application is not published, the webhook will fail.
> ![Create Dify Endpoint](../images/dify-workflow-publish.png)
To confirm that your webhook is working, you can create a simple workflow that catches the incoming data from Apify and sends it to a third-party request catcher like [Webhook.site](https://webhook.site/). This provides an easy way to inspect the data we send.
![Create Dify Endpoint](../images/dify-trigger-workflow.png)
Now we can start the Actor in the Apify Console and it will trigger our workflow.
![Create Dify Endpoint](../images/dify-trigger-succeded.png)
The setup for a Chatflow is nearly the same. The only differences are to select your Chatflow app instead of a Workflow and to copy the specific Chatflow endpoint URL.
> **Chatflow Trigger Requirement**
> Also, when triggering a **Chatflow**, you **must** provide a **Payload template** in the Apify webhook settings. This template needs a `query` field to serve as the first message to the chatflow.
> ![Chatflow Payload Template](../images/dify-trigger-query.png)
Triggers enable your Dify application to respond automatically to Apify events, such as completed Actor runs. This approach is ideal for creating event-driven automations.
### Set up a webhook endpoint
In your Dify app, go to **Overview** > **Endpoints** and select the **+** icon to create a new endpoint. Choose the **Workflow** or **Chatflow** application you want to trigger and give it a name. Select **Save**—Dify will generate two URLs.
![Create Dify Endpoint](../images/dify-workflow-input.png)
![Create Dify Endpoint](../images/dify-trigger-url.png)
Copy the URL that corresponds to your application type (Workflow or Chatflow).
### Configure the webhook in Apify
In the Apify Console, open the Actor you want to use as a trigger and go to the **Integrations** tab. Select the **HTTP webhook** option and paste the Dify endpoint URL. Under **Events**, select **Run succeeded** and save the integration.
![Create Dify Endpoint](../images/dify-trigger-webhook.png)
![Create Dify Endpoint](../images/dify-trigger-apify-console.png)
:::caution Publishing required
A Dify Workflow or Chatflow must be published for the webhook trigger to work. If the application is not published, the webhook will fail.
![Create Dify Endpoint](../images/dify-workflow-publish.png)
:::
To confirm that your webhook is working, create a simple workflow that catches the incoming data from Apify and sends it to a third-party request catcher like [Webhook.site](https://webhook.site/). This provides an easy way to inspect the data we send.
![Create Dify Endpoint](../images/dify-trigger-workflow.png)
Start the Actor in the Apify Console to trigger your workflow.
![Create Dify Endpoint](../images/dify-trigger-succeded.png)
### Trigger a Chatflow
The setup for a Chatflow is similar to a Workflow. Select your Chatflow app instead of a Workflow and copy the Chatflow endpoint URL.
When triggering a Chatflow, you must provide a **Payload template** in the Apify webhook settings. This template needs a `query` field to serve as the first message to the chatflow.
![Chatflow Payload Template](../images/dify-trigger-query.png)

Copy link
Member

@drobnikj drobnikj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look fine, thanks for format tuning @TC-MO.

I have a few points otherwise fine.

Comment on lines +105 to +110
1. Add the **Get Dataset Items** tool.
2. Enter the **Dataset ID** to retrieve items from. (e.g., `58S2Um7hSXWYghZhn`)
3. Add an **End** node and map its output to the tool's `json` result.

![Get Dataset Items Node](../images/dify-dataset-input.png)
![Get Dataset Items Node](../images/dify-dataset-succeded.png)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the Get Dataset Items tool and enter the Dataset ID to retrieve items from (for example, 58S2Um7hSXWYghZhn)

Let's update the example instead of hardcode dataset ID let's take it from previous step which could be Run an Actor or trigger

Comment on lines +179 to +183
## Troubleshooting

- Ensure your JSON inputs in fields are valid and properly formatted.

If you have any questions or need help, feel free to reach out to us on our [developer community on Discord](https://discord.com/invite/jyEM2PRvMU).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree the Troubleshooting section is not necessary there I would keep link to discord as we have it also in other integrations docs.

Maybe I would be nice to have this as some reusable block and put it in every integrations docs end. Currently if we want to change this section we would need to update it across all integrations.

Comment on lines +160 to +177
### Accessing Apify Data in Dify
When an event in Apify triggers your Dify endpoint, Apify sends a detailed nested response [JSON object](https://docs.apify.com/api/v2/act-runs-post#responses) containing information about the event. We can use this data to power our workflow.

Dify cannot directly use nested syntax like `resource.id` in its variable system. Instead, it requires you to access nested properties using a flattened format (`resource__id`), where each level of nesting is represented by a double underscore (`__`).

To work with a nested property in your workflow, you must first define it as an input variable in your workflow's Start node by clicking `+`.

![Chatflow Payload Template](../images/dify-workflow-input-variable.png)

![Chatflow Payload Template](../images/dify-define-input-variable.png)

![Chatflow Payload Template](../images/dify-workflow-with-input-variable.png)

We can also use that variable inside a JSON object we send and see the results.

![Chatflow Payload Template](../images/dify-input-variable-webhook.png)

![Chatflow Payload Template](../images/dify-input-variable-webhook-succeded.png)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Section

Accessing Apify Data in Dify

is little bit confusing, honestly after reading I'm still not sure how to do it. Can you try to explain it better, maybe add some refenrence to difi docs about nested fields? (if they have any)
Plus also help if you use some real word use case, like using defaultDatasetId to download data from triggered run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants