Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • added apify block/tools
  • remove unused icons in icons.tsx

Type of Change

  • New feature

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Nov 30, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs Ready Ready Preview Comment Nov 30, 2025 7:39am

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 30, 2025

Greptile Overview

Greptile Summary

This PR adds Apify integration to Sim, enabling workflow automation and web scraping through Apify actors. It implements two tools: synchronous execution for quick tasks (max 5 minutes) and asynchronous execution with polling for long-running operations (up to 5 minutes of polling). The implementation includes proper error handling, dataset fetching, and parameter validation.

Key Changes:

  • Added apify_run_actor_sync tool for synchronous actor execution with direct dataset retrieval
  • Added apify_run_actor_async tool with 5-second polling intervals and configurable item limits (1-250,000)
  • Created Apify block configuration with operation dropdown and conditional fields for async parameters
  • Registered both tools in the tools registry and block in the blocks registry
  • Added comprehensive documentation with usage examples and parameter tables
  • Added ApifyIcon component and cleaned up unused icons (UsersIcon, SettingsIcon, Spinner, and 40+ other unused icons)
  • API credentials correctly use user-only visibility per security guidelines

Implementation Quality:

  • Follows established patterns in the codebase for tool and block configuration
  • Proper TypeScript typing throughout
  • Error handling for JSON parsing, API failures, and timeout scenarios
  • Parameter validation (e.g., waitForFinish clamped to 0-60 seconds, itemLimit clamped to 1-250,000)
  • Authorization headers use both Bearer token and query parameter for API compatibility

Confidence Score: 5/5

  • This PR is safe to merge with no issues found
  • The implementation follows established patterns, includes comprehensive error handling, proper TypeScript typing, and correctly implements security guidelines for API credentials. The code is well-structured, properly registered in all necessary registries, and includes thorough documentation. No logical errors, security vulnerabilities, or architectural concerns were identified.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/tools/apify/run_actor_async.ts 5/5 Implements async Apify actor execution with polling for long-running tasks, with proper error handling and dataset fetching
apps/sim/tools/apify/run_actor_sync.ts 5/5 Implements synchronous Apify actor execution with direct dataset retrieval, uses correct API endpoint
apps/sim/tools/apify/types.ts 5/5 Defines TypeScript types and interfaces for Apify integration with clear documentation
apps/sim/blocks/blocks/apify.ts 5/5 Configures Apify block with operation dropdown, proper parameter handling, and conditional fields for async mode
apps/sim/components/icons.tsx 5/5 Added ApifyIcon component and removed unused icon components as stated in PR

Sequence Diagram

sequenceDiagram
    participant User
    participant Block as Apify Block
    participant Tool as Apify Tool
    participant API as Apify API
    participant Dataset as Apify Dataset

    User->>Block: Configure operation (sync/async)
    User->>Block: Provide API key & actor ID
    User->>Block: Set input parameters
    
    alt Synchronous Execution
        Block->>Tool: apify_run_actor_sync
        Tool->>API: POST /acts/{actorId}/run-sync-get-dataset-items
        API->>API: Execute actor
        API->>Dataset: Store results
        API-->>Tool: Return dataset items
        Tool-->>Block: Return success + items
        Block-->>User: Display results
    else Asynchronous Execution
        Block->>Tool: apify_run_actor_async
        Tool->>API: POST /acts/{actorId}/runs?waitForFinish=X
        API-->>Tool: Return run ID + initial status
        
        loop Poll every 5 seconds (max 5 minutes)
            Tool->>API: GET /acts/{actorId}/runs/{runId}
            API-->>Tool: Return run status
            alt Status is terminal (SUCCEEDED/FAILED/ABORTED/TIMED-OUT)
                break Exit polling loop
                end
            end
        end
        
        alt Run succeeded
            Tool->>Dataset: GET /datasets/{datasetId}/items?limit=X
            Dataset-->>Tool: Return items
            Tool-->>Block: Return success + items
            Block-->>User: Display results
        else Run failed/timed out
            Tool-->>Block: Return error status
            Block-->>User: Display error
        end
    end
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

12 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 merged commit d7a650a into staging Nov 30, 2025
5 checks passed
@waleedlatif1 waleedlatif1 deleted the feat/apify branch November 30, 2025 07:42
waleedlatif1 added a commit that referenced this pull request Dec 1, 2025
… sendgrid, linkedin, more tools (#2148)

* feat(tools): added smtp, sendgrid, mailgun, linkedin, fixed permissions in context menu (#2133)

* feat(tools): added twilio sendgrid integration

* feat(tools): added smtp, sendgrid, mailgun, fixed permissions in context menu

* added top level mocks for sporadically failing tests

* incr type safety

* fix(team-plans): track departed member usage so value not lost (#2118)

* fix(team-plans): track departed member usage so value not lost

* reset usage to 0 when they leave team

* prep merge with stagig

* regen migrations

* fix org invite + ws selection'

---------

Co-authored-by: Waleed <walif6@gmail.com>

* feat(i18n): update translations (#2134)

Co-authored-by: waleedlatif1 <waleedlatif1@users.noreply.github.com>

* feat(creators): add verification for creators (#2135)

* feat(tools): added apify block/tools  (#2136)

* feat(tools): added apify

* cleanup

* feat(i18n): update translations (#2137)

Co-authored-by: waleedlatif1 <waleedlatif1@users.noreply.github.com>

* feat(env): added more optional env var examples (#2138)

* feat(statuspage): added statuspage, updated list of tools in footer, renamed routes (#2139)

* feat(statuspage): added statuspage, updated list of tools in footer, renamed routes

* ack PR comments

* feat(tools): add generic search tool (#2140)

* feat(i18n): update translations (#2141)

* fix(sdks): bump sdk versions (#2142)

* fix(webhooks): count test webhooks towards usage limit (#2143)

* fix(bill): add requestId to webhook processing (#2144)

* improvement(subflow): remove all associated edges when moving a block into a subflow (#2145)

* improvement(subflow): remove all associated edges when moving a block into a subflow

* ack PR comments

* fix(polling): mark webhook failed on webhook trigger errors (#2146)

* fix(deps): declare core transient deps explicitly (#2147)

* fix(deps): declare core transient deps explicitly

* ack PR comments

---------

Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com>
Co-authored-by: waleedlatif1 <waleedlatif1@users.noreply.github.com>
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.

2 participants