Skip to content

v1.1.0

Compare
Choose a tag to compare
@drudge drudge released this 16 Nov 01:44
· 42 commits to main since this release

This release significantly enhances the Run Custom Script operation, bringing it closer to feature parity with n8n's native Code node while maintaining all the power of Puppeteer automation.

New Features

Console Logging Support

  • console.log statements in your custom scripts now work exactly like they do in the Code node
  • Output is displayed in:
    • Browser's console during test mode
    • Standard output (stdout) when executing in production

Special Variables & Helper Methods

  • Added support for all special variables and methods from the Code node
  • Remember, you can access Puppeteer-specific objects too using:
    • $browser - Browser instance
    • $page - Current page instance
    • $puppeteer - Puppeteer library
  • Seamlessly use familiar Code node helpers and utilities in your Puppeteer scripts

Enhanced Return Data Handling

  • Improved support for complex return data structures
  • Added support for binary properties, enabling direct handling of:
    • Screenshots
    • Downloaded files
    • Generated PDFs
    • Other binary data

Example Usage

Here's a simple example demonstrating the new binary property support with page screenshots:

await $page.goto('https://www.google.com')
const imageData = await $page.screenshot({ type: 'png', encoding: 'base64' })
return [
  {
    binary: {
      screenshot: {
        data: imageData,
        mimeType: 'image/png',
        fileName: 'screenshot.png',
      },
    },
  }
]