ZeroWork
  • 👋Home and Welcome
  • 🚀Getting Started
  • ⬇️Install the Agent
  • 🧑‍💻Crash Course
  • Using ZeroWork
    • 🖥️General: Run, Schedule, Share, Webhooks
      • Run
      • Stop
      • Log in to the Agent
      • Run Modes
        • Run Incognito
        • Run Non-Incognito
        • Run in My Regular Browser
      • Run Settings
        • Run in Background
        • Stay on Page after Run
        • Bring Pages to Front
      • TaskBot Sharing Options
      • Cookies
      • Scheduler
      • Trigger Run via Webhook
      • Proxies
      • Remote (Cloud) Execution
      • How to Check and Update Your Agent
      • Install ZeroWork Agent on VPS
    • 📔Using Selectors
      • What Are Selectors
      • Use Element's Text
      • Copy Selectors
      • How to Build Custom Selectors
        • Basic Concepts of Selectors
        • One Element Can Have Many Selector Expressions
        • Check if Selector Is Correct and Unique
        • Exact or Loose Match
        • Hierarchy
        • Combine Filters with Standard CSS Logic
        • Lists: Incremental CSS Selectors
        • Addressing Siblings
      • How to Use XPath in ZeroWork (advanced)
    • 🏗️Using Building Blocks
      • Open Link
      • Save Page Url
      • Switch or Close Tab
      • Go Back or Forward
      • Switch Frame
      • Browser Alert
      • Click Web Element
      • Check Web Element
      • Save Web Element
        • Save Lists
        • Enrich Existing Data
        • Stop Run If Selector Is Not Found Option
      • Insert Text or Data
      • Hover Web Element
      • Select Web Dropdown
      • Keyboard Action
      • Start Condition and Set Condition
        • Actions = & ≠
        • Actions <, ≤, >, ≥
        • Data Found & Data not Found
        • Contains & Does Not Contain
        • Before (Date) & After (Date)
      • Start Repeat
        • Standard Loop
        • Dynamic Loop
        • Continue until No Element Is Found
        • Auto-Scroll
        • Auto-Continue from Last Row or Element
        • Nested Loops - Handle Pagination
      • After Repeat
      • Break Repeat
      • Try-Catch
      • Raise Error
      • Abort Run
      • Update Data
      • Number Operations
        • Example: Standardize different formats
      • Format Data
        • Remove Words
        • Shorten Content Length
      • Split Data
      • Apply Regex
      • Remove Duplicates
      • Delete Data
      • Ask ChatGPT
      • Send Notification
      • APIs: Send HTTP Request
      • Write JavaScript
      • Save File
      • Upload File
      • Delay
      • Record Date
      • Take Screenshot
      • Save from Clipboard
      • Log
      • Building Block Options
        • Delay Times between the Building Blocks
        • Randomize Delay Time
        • Deactivate Building Blocks
        • Shortcuts
        • Spintax
        • Auto-Align
        • Sticky Notes
    • 🔀Using Variables
    • 💿Using Tables
      • How to Add Tables
      • Native Tables
      • Google Sheets
      • Import Data from CSV
      • Using Google Sheet vs. Native Tables
      • Create Columns
      • Export Data as CSV
      • Convert Native Table to a Google Sheet
    • 📄Using Run Reports
    • 😑Common Problems
      • My TaskBot Does Not Start Run
      • When I Use Data from Table, No Data is Being Pulled
      • Website is Glitching and Flashing
      • No Selector is Found
      • My TaskBot Saves Some Data but Not All
      • Data Is Saved in Wrong Format
      • Website Requires SMS or Email Verification
      • Keyboard Action Is Not Working As Expected
      • Check Web Element Identifies Selector as Found but Next Action Does Not
      • When Using Insert Data Block, First Letters Are Cut Off
      • Workflow Has More than One Starting Building Block
      • TaskBot Does Not Automatically Scroll
  • Support
    • 🆘Getting Support
  • 🆕Release Notes
    • Version 1.1.61
    • Version 1.1.62
    • Version 1.1.63
    • Version 1.1.64
    • Version 1.1.65
    • Version 1.1.66
    • Version 1.1.67
    • Version 1.1.68
Powered by GitBook
On this page
  • Generate Webhook Link
  • Deactivate Webhook Link
  • Generate a New Link
  • Send Dynamic Data
  • Trigger Webhook within a TaskBot Run

Was this helpful?

  1. Using ZeroWork
  2. General: Run, Schedule, Share, Webhooks

Trigger Run via Webhook

PreviousSchedulerNextProxies

Last updated 3 months ago

Was this helpful?

  • Before you can use webhooks to trigger TaskBot run on your desktop agent, you need to log in to your agent, as described here: Log in to the Agent.

  • During the triggered run, your agent must be active. That means if you quit it or restarted your computer after which you didn't activate the agent, the run won't happen because there is no agent to run it.

  • During the triggered run, your computer must be turned on and active. You may want to adjust your sleep mode and battery settings to ensure that your computer doesn't turn off or switch to a sleep mode for the time that the TaskBot is scheduled to run.

Generate Webhook Link

Go to your TaskBot builder page, open TaskBot Settings and click on Generate Webhook.

Once generated, you will be able to copy the link and use it to trigger TaskBot run programmatically. You can use this link in third-party applications such as Zapier, Make, Pabbly, etc. The webhook can be triggered with a POST or GET method.

Beware that anyone with this link can trigger TaskBot run on your account. If you ever shared this link with anyone and now want to remove their access, you can either deactivate your webhook link or generate a new one.

Deactivate Webhook Link

Simply toggle Webhook is active option off. If the webhook is not active, it cannot be triggered.

Generate a New Link

To generate a new link, delete your current one by clicking on the trash bin icon and then click on Generate Webhook button again. This action will generate a new link, and the old one will be permanently deleted.

Send Dynamic Data

In a POST request, you can send dynamic data in the payload body. Query parameters are also supported (in both GET and POST requests).

In-built variable zw_webhook_data

Your data from the request body is always saved in the variable called zw_webhook_data. You do not need to create this variable manually. Whenever you trigger your TaskBot by a webhook, the variable will be updated or, if not created yet, automatically created.

The data is saved in stringified JSON format.

Tip: You can access nested objects or arrays that were saved to zw_webhook_data in Write JavaScript building block by using JSON.parse() method. Here is an example:

Match specific values from your dynamic data to variables

You can also create variables, and the data in your webhook payload will be matched to those. In addition to matching, the whole payload will still be saved to the aforementioned zw_webhook_data variable.

Example

Consider your TaskBot has these variables:

You can add variable names and values as key-value pairs to your request body. For example, if you make your request via Postman (or any other API application), this is how it would look like:

After sending the webhook request as shown above, this would be the new state of your variables:

Match nested objects or arrays to variables

You can create variables as JSON paths to match nested objects or arrays (as well as execute JSON path supported queries on your payload).

Example

Consider this to be your webhook payload data:

{
    "city": {
        "name": "Berlin",
        "country": "Germany",
    }
}

This is how you can create a variable for one of the nested values:

Example of advanced JSON path use

JSON path operators (wildcard, filter, recursive descent) and query behavior are supported.

Here is an example. Consider this to be your webhook payload data:

{
    "cities": [
        {
            "city": "Berlin",
            "population": 3577000,
            "country": {
                "name": "Germany",
                "identifier": "DE"
            }
        },
        {
            "city": "London",
            "population": 9748000,
            "country": {
                "name": "United Kingdom",
                "identifier": "UK"
            }
        },
        {
            "city": "New York",
            "population": 9469232,
            "country": {
                "name": "United States",
                "identifier": "US"
            }
        }
    ]
}

To get an array of all cities, you can use the wildcard operator * as in cities[*].city.

Similarly, you can use filter operators supported by JSON path to query specific data. Examples:

  • Filter for the city object where city is Berlin: cities[?(@.city==="Berlin")].

  • Filter for the cities with population over 5M: cities[?(@.population>5000000)]. This will return an array of city objects of those cities where population is over 5M.

Notes

  • You do not need to include all (or any at all) variables in your body request. Include only those variables that you need to match data to.

  • Matching is case-sensitive. For example, "Link" will be matched to "Link" and will not be matched to "LINK" or "link".

  • If your JSON path is invalid or there is no match between some of the TaskBot variables and the webhook payload data, no error will be thrown.

Trigger Webhook within a TaskBot Run

Sometimes you might want to trigger another TaskBot within a TaskBot run. For this, you can use Send HTTP Request building block (see APIs: Send HTTP Request). See example set-up below.

JSON path variable can be created with or without the dollar $ character. You can evaluate your JSON path here: . The resource can also help you validate your JSON path syntax.

🖥️
https://jsonpath.com/