Webhook triggered when an event occurs
X-Webhooks-Signature header.
X-Webhooks-Signature: HMAC signature (includes version prefix)X-Webhooks-Timestamp: Unix timestamp in secondsX-Webhooks-Id: Unique identifier for this webhook deliveryX-Webhooks-Signature (remove the version prefix)X-Webhooks-TimestampX-Webhooks-Id{webhookId}.{timestamp}.{raw_body}const crypto = require('crypto');
function verifyWebhookSignature(
webhookId,
payload,
signature,
timestamp,
secret
) {
const signedPayload = `${webhookId}.${timestamp}.${payload}`;
const keyBytes = Buffer.from(secret, 'base64url');
const expectedSignature = crypto
.createHmac('sha256', keyBytes)
.update(signedPayload, 'utf8')
.digest('hex');
if (signature.length !== expectedSignature.length) {
return false;
}
return crypto.timingSafeEqual(
Buffer.from(signature, 'hex'),
Buffer.from(expectedSignature, 'hex')
);
}
app.post('/webhook', express.raw({ type: 'application/json' }), (req, res) => {
const webhookId = req.headers['x-webhooks-id'];
const signatureHeader = req.headers['x-webhooks-signature'];
const timestamp = req.headers['x-webhooks-timestamp'];
if (!webhookId || !signatureHeader || !timestamp) {
return res.status(401).json({ error: 'Missing required headers' });
}
const signature = signatureHeader.replace(/^v\d+=/, '');
const payload = req.body.toString();
const webhookSecret = process.env.WEBHOOK_SECRET;
if (
!webhookSecret ||
!verifyWebhookSignature(
webhookId,
payload,
signature,
timestamp,
webhookSecret
)
) {
return res.status(401).json({ error: 'Invalid signature' });
}
const event = JSON.parse(payload);
// Process the webhook event
res.status(200).json({ received: true });
});
A webhook event payload containing event type and data
"execution.complete"Data about the completed execution.
Show child attributes
Unique identifier for the execution
Authentication responses for this execution
Show child attributes
When the execution started
Execution name
The block where execution started, if specified
Show child attributes
"Login"Show child attributes
sequence, trueSequence, falseSequence Show child attributes
Session authentication responses with login summary for this execution
Show child attributes
ID of the context authentication
Show child attributes
ID of the login used for authentication
Name of the login used for authentication
Whether this login requires manual authentication
Current status of the authentication from browser context
Unauthenticated, AuthenticationInProgress, Authenticated ID of the session associated with this execution
Duration of the execution in milliseconds
When the execution completed (if finished)
Preview of the response from the execution
File containing the complete execution response as JSON
Show child attributes
Unique identifier for the file
Name of the file
MIME type of the file
Size of the file in bytes
URL to download the file
Key identifier for the file (for example, a key provided when completing a download for the file).
ID of the browser session used for execution
Vendor-specific session ID from the serverless browser provider
Completed File downloads from the execution
Show child attributes
pending, in_progress, success, failed Show child attributes
Unique identifier for the file
Name of the file
MIME type of the file
Size of the file in bytes
Signed URL to download the file directly
Key identifier for the file (for example, a key provided when completing a download for the file).
ID of the parent execution that triggered this execution
Webhook received successfully