Skip to content

Conversation

@matyascimbulka
Copy link
Collaborator

WHY

Improves the run Actor action to align it with other integrations. The new props for the action look like this:
Screenshot 2025-07-23 at 13 56 28

Links to #1, #3 and #9

Changes

  • Add search source for Actors: Store and Recently run Actors
  • Change how Actors (and tasks) are displayed. The current format is: title (username/name) (like Zapier)
  • Remove wait for finish input for synchronous runs. If the run takes too long it just kills the action.

@matyascimbulka matyascimbulka self-assigned this Jul 23, 2025
@matyascimbulka matyascimbulka added the enhancement New feature or request label Jul 23, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the Apify Actor run action to improve user experience and align with other integrations. The changes add a new search source selection for Actors, update the display format to show more descriptive labels, and simplify synchronous runs by removing the wait timeout option.

  • Add Actor search source selection (Store vs Recently used Actors)
  • Update Actor and Task display format to include title and username/name format
  • Remove wait for finish input for synchronous runs and use build parameter instead

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.

File Description
components/apify/sources/new-finished-actor-run-instant/new-finished-actor-run-instant.mjs Updates prop definition reference from userActorId to actorId
components/apify/apify.app.mjs Consolidates Actor selection logic, adds search source functionality, and updates display formatting
components/apify/actions/run-actor/run-actor.mjs Adds Actor source selection, removes wait timeout, and updates parameter handling
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

value,
] of Object.entries(data)) {
const editor = properties[key].editor;
const editor = properties[key]?.editor;
Copy link

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

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

Adding optional chaining here suggests that properties[key] might be undefined, but this could cause silent failures. The code should handle the case where the property doesn't exist more explicitly to avoid unexpected behavior in the setValue function.

Suggested change
const editor = properties[key]?.editor;
let editor;
if (properties[key]) {
editor = properties[key].editor;
} else {
console.warn(`Property "${key}" is not defined in the schema.`);
editor = undefined; // Or assign a default value if appropriate
}

Copilot uses AI. Check for mistakes.
@drobnikj drobnikj requested a review from protoss70 July 29, 2025 08:10
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.

Just a few notes

name: "Run Actor",
description: "Performs an execution of a selected Actor in Apify. [See the documentation](https://docs.apify.com/api/v2#/reference/actors/run-collection/run-actor)",
version: "0.0.4",
description: "Performs an execution of a selected actor in Apify. [See the documentation](https://docs.apify.com/api/v2#/reference/actors/run-collection/run-actor)",
Copy link
Member

Choose a reason for hiding this comment

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

Why did you changed Actor->actor, it was correct before. It should be Actor.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm ... I'm not sure. I'll change it back

type: "boolean",
label: "Run Asynchronously",
description: "Set to `true` to run the Actor asynchronously",
description: "Set to `true` to run the actor asynchronously",
Copy link
Member

Choose a reason for hiding this comment

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

Actor

const summary = this.runAsynchronously
? `Successfully started Actor run with ID: ${response.data.id}`
: `Successfully ran Actor with ID: ${this.actorId}`;
? `Successfully started actor run with ID: ${response.data.id}`
Copy link
Member

Choose a reason for hiding this comment

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

Actor

description: "Where to search for Actors. Valid options are Store and Recently used Actors.",
options: [
{
label: "Store",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
label: "Store",
label: "Apify Store Actors",

id: value, title, username, name,
}) => ({
label,
label: `${title} (${username}/${name})`,
Copy link
Member

Choose a reason for hiding this comment

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

Title is optional, so there can be a case that the title is missing in that case, let's show just the tech name ${username}/${name}

id: value, title, username, name,
}) => ({
label,
label: `${title} (${username}/${name})`,
Copy link
Member

Choose a reason for hiding this comment

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

Let's move to formating label into function to DRY

@matyascimbulka matyascimbulka requested a review from drobnikj July 29, 2025 13:00
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.

LGTM

@matyascimbulka matyascimbulka merged commit b2de09c into master Aug 1, 2025
3 of 7 checks passed
@matyascimbulka matyascimbulka deleted the feat/actor-run-improvments branch August 1, 2025 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants