Skip to content

2116 - Apify component added #2712

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
124 changes: 124 additions & 0 deletions docs/content/docs/reference/components/apify.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
---
title: "Apify"
description: "Apify is the largest ecosystem where developers build, deploy, and publish data extraction and web automation tools."
---

Apify is the largest ecosystem where developers build, deploy, and publish data extraction and web automation tools.


Categories: Marketing Automation


Type: apify/v1

<hr />



## Connections

Version: 1


### Bearer Token

#### Properties

| Name | Label | Type | Description | Required |
|:---------------:|:--------------:|:------------:|:-------------------:|:--------:|
| token | Token | STRING | | true |





<hr />



## Actions


### Get Last Run
Name: getLastRun

`Get Apify Actor last run.`

#### Properties

| Name | Label | Type | Description | Required |
|:---------------:|:--------------:|:------------:|:-------------------:|:--------:|
| actorId | Actor ID | STRING | `ID of the actor that will be fetched.` | true |

#### Example JSON Structure
```json
{
"label" : "Get Last Run",
"name" : "getLastRun",
"parameters" : {
"actorId" : ""
},
"type" : "apify/v1/getLastRun"
}
```

#### Output



Type: OBJECT


#### Properties

| Name | Type | Description |
|:------------:|:------------:|:-------------------:|
| id | STRING | The ID of the newly created opportunity. |
| name | STRING | The name of the newly created opportunity. |




#### Output Example
```json
{
"id" : "",
"name" : ""
}
```


### Start Actor
Name: startActor

`Starts an Apify Actor`

#### Properties

| Name | Label | Type | Description | Required |
|:---------------:|:--------------:|:------------:|:-------------------:|:--------:|
| actorId | Actor ID | STRING | `ID of the actor that will be run.` | true |
| body | Body | STRING | `The JSON input to pass to the Actor [you can get the JSON from a run in your Apify account].` | true |

#### Example JSON Structure
```json
{
"label" : "Start Actor",
"name" : "startActor",
"parameters" : {
"actorId" : "",
"body" : ""
},
"type" : "apify/v1/startActor"
}
```

#### Output

The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.






1 change: 1 addition & 0 deletions server/apps/server-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ dependencies {
implementation(project(":server:libs:modules:components:ai:vectorstore:weaviate"))
implementation(project(":server:libs:modules:components:airtable"))
implementation(project(":server:libs:modules:components:aitable"))
implementation(project(":server:libs:modules:components:apify"))
implementation(project(":server:libs:modules:components:apollo"))
implementation(project(":server:libs:modules:components:app-event"))
implementation(project(":server:libs:modules:components:approval-link"))
Expand Down
1 change: 1 addition & 0 deletions server/ee/apps/worker-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ dependencies {
implementation(project(":server:libs:modules:components:ai:vectorstore:weaviate"))
implementation(project(":server:libs:modules:components:airtable"))
implementation(project(":server:libs:modules:components:aitable"))
implementation(project(":server:libs:modules:components:apify"))
implementation(project(":server:libs:modules:components:apollo"))
implementation(project(":server:libs:modules:components:app-event"))
implementation(project(":server:libs:modules:components:approval-link"))
Expand Down
43 changes: 43 additions & 0 deletions server/libs/modules/components/apify/openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
openapi: "3.0.1"
info:
title: "Apify"
description: "Apify is the largest ecosystem where developers build, deploy, and publish data extraction and web automation tools."
version: "v1"
servers:
- url: "https://api.apify.com/v2"
paths:
/acts/{actorId}/runs/last:
get:
summary: "Get Last Run"
description: "Get Apify Actor last run."
operationId: "getLastRun"
x-ai-agent-tool: true
parameters:
- name: "actorId"
in: "path"
description: "ID of the actor that will be fetched."
required: true
schema:
type: "string"
title: "Actor ID"
x-dynamic-options: true
responses:
200:
description: "Successful operation."
content:
application/json:
schema:
type: "object"
properties:
id:
type: "string"
description: "The ID of the newly created opportunity."
name:
type: "string"
description: "The name of the newly created opportunity."
components:
securitySchemes:
bearerAuth:
type: "http"
scheme: "bearer"
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright 2025 ByteChef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.bytechef.component.apify;

import static com.bytechef.component.definition.ComponentDsl.component;
import static com.bytechef.component.definition.ComponentDsl.tool;

import com.bytechef.component.OpenApiComponentHandler;
import com.bytechef.component.apify.action.ApifyGetLastRunAction;
import com.bytechef.component.apify.connection.ApifyConnection;
import com.bytechef.component.definition.ComponentDefinition;

/**
* Provides the base implementation for the REST based component.
*
* @generated
*/
public abstract class AbstractApifyComponentHandler implements OpenApiComponentHandler {
private final ComponentDefinition componentDefinition = modifyComponent(
component("apify")
.title("Apify")
.description(
"Apify is the largest ecosystem where developers build, deploy, and publish data extraction and web automation tools."))
.actions(modifyActions(ApifyGetLastRunAction.ACTION_DEFINITION))
.connection(modifyConnection(ApifyConnection.CONNECTION_DEFINITION))
.clusterElements(modifyClusterElements(tool(ApifyGetLastRunAction.ACTION_DEFINITION)))
.triggers(getTriggers());

@Override
public ComponentDefinition getDefinition() {
return componentDefinition;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Copyright 2025 ByteChef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.bytechef.component.apify;

import static com.bytechef.component.definition.ComponentDsl.tool;

import com.bytechef.component.OpenApiComponentHandler;
import com.bytechef.component.apify.action.ApifyStartActorAction;
import com.bytechef.component.definition.ClusterElementDefinition;
import com.bytechef.component.definition.ComponentCategory;
import com.bytechef.component.definition.ComponentDsl.ModifiableActionDefinition;
import com.bytechef.component.definition.ComponentDsl.ModifiableComponentDefinition;
import com.google.auto.service.AutoService;
import java.util.List;

/**
* @author Nikolina Spehar
*/
@AutoService(OpenApiComponentHandler.class)
public class ApifyComponentHandler extends AbstractApifyComponentHandler {

@Override
public ModifiableComponentDefinition modifyComponent(ModifiableComponentDefinition modifiableComponentDefinition) {
return modifiableComponentDefinition
.icon("path:assets/apify.svg")
.categories(ComponentCategory.MARKETING_AUTOMATION);
}

@Override
public List<? extends ModifiableActionDefinition> getCustomActions() {
return List.of(ApifyStartActorAction.ACTION_DEFINITION);
}

@Override
public List<ClusterElementDefinition<?>> getCustomClusterElements() {
return List.of(tool(ApifyStartActorAction.ACTION_DEFINITION));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* Copyright 2025 ByteChef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.bytechef.component.apify.action;

import static com.bytechef.component.OpenApiComponentHandler.PropertyType;
import static com.bytechef.component.definition.ComponentDsl.action;
import static com.bytechef.component.definition.ComponentDsl.object;
import static com.bytechef.component.definition.ComponentDsl.outputSchema;
import static com.bytechef.component.definition.ComponentDsl.string;
import static com.bytechef.component.definition.Context.Http.ResponseType;

import com.bytechef.component.apify.util.ApifyUtils;
import com.bytechef.component.definition.ComponentDsl;
import com.bytechef.component.definition.OptionsDataSource;
import java.util.Map;

/**
* Provides a list of the component actions.
*
* @generated
*/
public class ApifyGetLastRunAction {
public static final ComponentDsl.ModifiableActionDefinition ACTION_DEFINITION = action("getLastRun")
.title("Get Last Run")
.description("Get Apify Actor last run.")
.metadata(
Map.of(
"method", "GET",
"path", "/acts/{actorId}/runs/last"

))
.properties(string("actorId").label("Actor ID")
.description("ID of the actor that will be fetched.")
.required(true)
.options((OptionsDataSource.ActionOptionsFunction<String>) ApifyUtils::getActorIdOptions)
.metadata(
Map.of(
"type", PropertyType.PATH)))
.output(outputSchema(object().properties(string("id").description("The ID of the newly created opportunity.")
.required(false),
string("name").description("The name of the newly created opportunity.")
.required(false))
.metadata(
Map.of(
"responseType", ResponseType.JSON))));

private ApifyGetLastRunAction() {
}
}
Loading