• Builds
  • latest 0.0.10 / 2018-06-12
  • Created 2018-04-18
  • Last modified 2018-09-18
  • grade 2


Fetches information about a crawler run and sends it to the user by email. For example, this actor can be used to inform the user that the crawler run finished. To do that, simply put the following URL into "Finish webhook URL" setting of your crawler:<YOUR_API_TOKEN> That's it, it does not require any other configuration.


To run the actor, send a HTTP POST request to:<YOUR_API_TOKEN>

The POST payload will be passed as input for the actor. For more information, read the docs.

Example input

Content type: application/json; charset=utf-8


Source code

Based on the apify/actor-node-basic Docker image (see docs).

const Apify = require('apify');

Apify.main(async () => {
    // Get act input and validate it
    const input = await Apify.getValue('INPUT');
    if (!input || !input._id) {
        throw new Error('Input is missing the "_id" attribute. Did you start it from the crawler finish webhook?');
    const executionId = input._id;
    // Print info about crawler run
    const crawlerRunDetails = await Apify.client.crawlers.getExecutionDetails({ executionId });
    if (!crawlerRunDetails) {
        throw new Error(`There is no crawler run with ID: "${executionId}"`);
    console.log(`Details of the crawler run (ID: ${executionId}):`);
    console.log('Fetching user\'s email');
    const user = await Apify.client.users.getUser();
    // Send email
    console.log('Sending email...');
    await'apify/send-mail', {
      "subject": `Crawler run ${executionId} finished`,
      "text": `Info about crawler run:\n\n${JSON.stringify(crawlerRunDetails,null,2)}`