Credits Left
Checks the number of API credits remaining in your Dropcontact account.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Options
- API Key - Dropcontact API key for authentication (credential type).
Output
- credits - A numeric value representing the number of API credits remaining in your account.
How It Works
The Credits Left node queries your Dropcontact account to check remaining credits. When executed, the node:
- Constructs a minimal POST request to the Dropcontact batch API
- Sends a dummy payload with an empty data object
- Adds authentication headers with the API key
- Sends the request to
https://api.dropcontact.io/batch - Parses the response to extract the
credits_leftfield - Returns the credit count as a numeric value
Requirements
- A valid Dropcontact account with API access
- API key configured in credentials
Error Handling
The node will return specific errors in the following cases:
ErrCredentials- Failed to retrieve API key from credentialsErrInternal- Failed to create HTTP requestErrRuntime- Failed to send request, parse response, or credits_left field not found in response
Usage Notes
- This node does not consume credits when checking the balance
- Use this node before large batch operations to ensure sufficient credits
- Credits are only consumed when emails are found or verified
- One credit equals one successfully found or verified email
- The node makes a lightweight API call that returns credit information
- Credits are shared across all API operations on your account
Credit System
Dropcontact's credit model:
- 1 credit = 1 email found or verified
- Credits are NOT charged for:
- Contacts that don't match (no email found)
- Phone number enrichment
- Company information enrichment
- Name normalization
- Credits ARE charged for:
- Email addresses discovered
- Email addresses verified
- Each verified email in the response
Example: Check Credits Before Batch
Flow Setup:
- Credits Left node - Check available credits
- Decision node - Verify sufficient credits available
- If yes → Continue with Batch Post
- If no → Send notification and stop
Output:
credits: 1250
Decision Logic:
// Check if we have enough credits for the batch
let creditsNeeded = 250; // Planning to process 250 contacts
let creditsAvailable = $.credits;
if (creditsAvailable < creditsNeeded) {
throw new Error(`Insufficient credits. Need ${creditsNeeded}, have ${creditsAvailable}`);
}
Example: Credit Monitoring Flow
This example monitors credits and sends alerts when running low:
- Trigger - Schedule to run daily
- Credits Left - Check current credit balance
- JavaScript - Evaluate credit threshold:
let threshold = 500; // Alert threshold
let credits = $.credits;
return {
credits: credits,
isLow: credits < threshold,
urgency: credits < 100 ? "critical" : credits < threshold ? "warning" : "ok"
};
- Condition - If credits are low
- Mail - Send alert email to admin
- Slack - Post notification to team channel
Alert Message Template:
Warning: Dropcontact credits running low
Current balance: {credits}
Threshold: {threshold}
Action required: Purchase additional credits
Example: Dynamic Batch Sizing
Adjust batch size based on available credits:
- Credits Left - Get available credits
- Read CSV - Load contacts to process
- JavaScript - Calculate optimal batch size:
let maxBatchSize = 250;
let availableCredits = $.credits;
let reserveCredits = 100; // Keep some in reserve
// Calculate safe batch size (assuming 50% match rate)
let estimatedNeeded = maxBatchSize * 0.5;
let safeBatchSize = maxBatchSize;
if (availableCredits - reserveCredits < estimatedNeeded) {
safeBatchSize = Math.floor((availableCredits - reserveCredits) / 0.5);
safeBatchSize = Math.max(1, safeBatchSize); // At least 1
}
return {
batchSize: safeBatchSize,
canProceed: safeBatchSize >= 1
};
- Loop - Process contacts in calculated batch size
- Batch Post - Submit limited batch
Example: Credit Usage Tracking
Track credit consumption across batch operations:
- Credits Left - Get initial credit count (before_credits)
- Store - Save to variable:
before_credits - Batch Post - Submit contacts for enrichment
- Delay - Wait for processing
- Batch Result - Retrieve enriched data
- Credits Left - Get final credit count (after_credits)
- JavaScript - Calculate credits consumed:
let consumed = $.before_credits - $.after_credits;
let contactsProcessed = $.result.total_count;
let successRate = (consumed / contactsProcessed * 100).toFixed(2);
return {
credits_consumed: consumed,
contacts_processed: contactsProcessed,
success_rate: successRate + "%",
avg_cost_per_contact: (consumed / contactsProcessed).toFixed(2)
};
- Log - Record usage metrics
- Excel - Append to usage report
Example: Pre-flight Credit Check
Validate sufficient credits before starting automation:
// Pre-flight credit check function
async function validateCredits(requiredCredits) {
let available = $.credits;
let safetyMargin = 50; // Keep 50 credits as buffer
if (available < requiredCredits + safetyMargin) {
return {
canProceed: false,
message: `Insufficient credits. Required: ${requiredCredits}, Available: ${available}`,
shortage: (requiredCredits + safetyMargin) - available
};
}
return {
canProceed: true,
message: `Credit check passed. Available: ${available}`,
remaining: available - requiredCredits
};
}
// Usage
let contactCount = 500;
let estimatedCost = Math.ceil(contactCount * 0.6); // Assume 60% match rate
let check = await validateCredits(estimatedCost);
if (!check.canProceed) {
throw new Error(check.message);
}
console.log(check.message);
Common Errors and Solutions
Error: "Failed to get API key"
Cause: API key credential is not configured or invalid Solution:
- Verify the Dropcontact API Key credential exists in vault
- Ensure the credential is properly selected in the node options
- Check that the API key is active in your Dropcontact account
Error: "credits_left not found in response"
Cause: API response doesn't contain the credits_left field Solution:
- Verify your API key is valid and active
- Check Dropcontact service status
- Ensure you have an active subscription with Dropcontact