Talent Pool Automation

Vielversprechende Kandidaten automatisch in den Talent Pool aufnehmen — kein manueller Aufwand mehr.

Das Problem

Gute Kandidaten, die für eine Stelle nicht ausgewählt wurden, gehen verloren, wenn kein Talent Pool aufgebaut wird. Manuelles Sichten aller Ablehnungen ist zu aufwändig.

Lösung: Automatische Aufnahme nach Rating

talent-pool-automation.jsJavaScript
const BASE = "https://api.aeroselect.io/api/v2/external";
const headers = { "X-API-Key": process.env.AEROSELECT_API_KEY };

// Alle Kandidaten, die bis ins Interview kamen, aber abgelehnt wurden,
// automatisch in den Talent Pool aufnehmen
async function autoFillTalentPool() {
  const res = await fetch(
    `${BASE}/applications?status=rejected&per_page=100`,
    { headers }
  );
  const { data: rejected } = await res.json();

  // Only add candidates who reached at least the interview stage
  const promising = rejected.filter((app) =>
    ["interview", "offered"].some((status) =>
      app.status_history?.some((h) => h.status === status)
    )
  );

  let added = 0;
  for (const application of promising) {
    // Duplikat-sicher: POST gibt 200 wenn schon vorhanden
    const res = await fetch(`${BASE}/talent-pool`, {
      method: "POST",
      headers: { ...headers, "Content-Type": "application/json" },
      body: JSON.stringify({
        candidate_id: application.candidate.id,
        rating: 4,
        tags: ["Vorgemerkter Kandidat", "Abgelehnt — Timing", application.job.title],
        notes: `Abgelehnt für: ${application.job.title}. Bis zum Interview gekommen.`,
      }),
    });
    if (res.ok) added++;
  }

  console.log(`${added} Kandidaten in Talent Pool aufgenommen`);
}

Talent Pool nach Qualifikation filtern

pool-filter.pyPython
import requests, os

BASE = "https://api.aeroselect.io/api/v2/external"
headers = {"X-API-Key": os.environ["AEROSELECT_API_KEY"]}

def find_pool_candidates_with_rating(min_rating: int, tag: str) -> list:
    """Talent Pool nach Rating und Tag filtern."""
    response = requests.get(
        f"{BASE}/talent-pool",
        headers=headers,
        params={"per_page": 100}
    )
    pool = response.json()["data"]
    return [
        entry for entry in pool
        if (entry.get("rating") or 0) >= min_rating
        and tag in (entry.get("tags") or [])
    ]

// Alle A320-gerateten Kandidaten mit Rating >= 4
a320_candidates = find_pool_candidates_with_rating(4, "A320 Rated")
print(f"{len(a320_candidates)} geeignete A320-Kandidaten im Pool")

Benachrichtigung bei neuer passender Stelle

notify-pool.jsJavaScript
// Wenn ein neuer Job veröffentlicht wird, passende Talent-Pool-Kandidaten benachrichtigen
async function notifyMatchingPoolCandidates(jobId: number) {
  const [jobRes, poolRes] = await Promise.all([
    fetch(`${BASE}/jobs/${jobId}`, { headers }),
    fetch(`${BASE}/talent-pool?per_page=100`, { headers }),
  ]);

  const { data: job } = await jobRes.json();
  const { data: pool } = await poolRes.json();

  // Einfaches Tag-Matching
  const jobTags = job.skills ?? [];
  const matching = pool.filter((entry) =>
    entry.tags?.some((tag) => jobTags.includes(tag))
  );

  console.log(
    `Neue Stelle "${job.title}": ${matching.length} passende Kandidaten im Pool`
  );

  // Send email notification via your email service
  for (const entry of matching) {
    await emailService.send({
      to: entry.candidate.email,
      subject: `Neue passende Stelle: ${job.title}`,
      body: `Eine neue Stelle passt zu Ihrem Profil...`,
    });
  }
}