Skip to main content

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.
info

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:

  1. Constructs a minimal POST request to the Dropcontact batch API
  2. Sends a dummy payload with an empty data object
  3. Adds authentication headers with the API key
  4. Sends the request to https://api.dropcontact.io/batch
  5. Parses the response to extract the credits_left field
  6. 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 credentials
  • ErrInternal - Failed to create HTTP request
  • ErrRuntime - 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:

  1. Credits Left node - Check available credits
  2. Decision node - Verify sufficient credits available
  3. If yes → Continue with Batch Post
  4. 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:

  1. Trigger - Schedule to run daily
  2. Credits Left - Check current credit balance
  3. 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"
};
  1. Condition - If credits are low
  2. Mail - Send alert email to admin
  3. 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:

  1. Credits Left - Get available credits
  2. Read CSV - Load contacts to process
  3. 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
};
  1. Loop - Process contacts in calculated batch size
  2. Batch Post - Submit limited batch

Example: Credit Usage Tracking

Track credit consumption across batch operations:

  1. Credits Left - Get initial credit count (before_credits)
  2. Store - Save to variable: before_credits
  3. Batch Post - Submit contacts for enrichment
  4. Delay - Wait for processing
  5. Batch Result - Retrieve enriched data
  6. Credits Left - Get final credit count (after_credits)
  7. 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)
};
  1. Log - Record usage metrics
  2. 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

Error: "Failed to send request"

Cause: Network connectivity issues or API endpoint unreachable Solution:

  • Check internet connectivity
  • Verify firewall settings allow HTTPS to dropcontact.io
  • Retry after a brief delay

Negative or unexpected credit values

Cause: Account may have expired or been suspended Solution:

  • Log in to your Dropcontact account to verify status
  • Check if your subscription is active
  • Contact Dropcontact support if the issue persists

Best Practices

  1. Regular Monitoring: Check credits before large batch operations
  2. Alerting: Set up automated alerts when credits drop below thresholds
  3. Budget Management: Track credit consumption per workflow for cost analysis
  4. Safety Margins: Always maintain a buffer of credits for critical operations
  5. Batch Sizing: Dynamically adjust batch sizes based on available credits
  6. Usage Reporting: Log credit usage with timestamps for billing reconciliation
  7. Error Handling: Enable Continue On Error for non-critical credit checks
  8. Estimation: Assume 50-70% match rate when estimating credit needs
  9. Pre-validation: Always check credits before starting large automation jobs
  10. Credit Recovery: Build retry logic that waits for credit renewal if running low

Credit Optimization Tips

Maximize Credit Efficiency:

  1. Data Quality: Clean and validate data before submission

    • Remove duplicates
    • Validate email formats
    • Ensure company names are accurate
  2. Target Selection: Only enrich contacts you actually need

    • Filter out low-priority contacts
    • Skip contacts with existing verified emails
    • Focus on high-value prospects
  3. Batch Timing: Spread large operations over time

    • Process smaller batches more frequently
    • Avoid rush jobs that may need re-runs
    • Schedule during off-peak hours if relevant
  4. Result Caching: Store and reuse enrichment results

    • Save enriched data to database
    • Don't re-enrich the same contacts
    • Implement data freshness checks
  5. Smart Retries: Don't retry contacts that had no matches

    • Track unsuccessful enrichments
    • Only retry after significant data changes
    • Focus retries on partial matches

Understanding Credit Consumption

When credits are consumed:

  • Email address is found for a contact
  • Email address is verified (even if already known)
  • Multiple emails found for one contact = multiple credits

When credits are NOT consumed:

  • No email found for a contact
  • Only company information enriched
  • Only name normalization performed
  • Phone number enrichment without email
  • Duplicate contact in same batch

Example Credit Usage:

Batch of 100 contacts submitted:
- 60 contacts: Email found and verified = 60 credits
- 20 contacts: No email found = 0 credits
- 15 contacts: Company info only = 0 credits
- 5 contacts: Duplicates = 0 credits
Total credits consumed: 60

Integration with Workflows

Common patterns for credit management:

Pattern 1: Conditional Processing

Credits Left → Check threshold → If sufficient → Process batch
→ If insufficient → Notify admin

Pattern 2: Dynamic Sizing

Credits Left → Calculate safe batch size → Loop with size → Batch Post

Pattern 3: Usage Tracking

Before credits → Process → After credits → Calculate difference → Log metrics

Pattern 4: Alert System

Scheduled trigger → Credits Left → Evaluate → Send alerts if low

Pattern 5: Cost Estimation

Count contacts → Estimate cost → Credits Left → Validate budget → Proceed or defer