API Flowchart This workshop is designed for technical professionals and managers who want to learn how to use application programming interfaces (APIs) and explore how AI can enhance document workflows. Attendees will get hands-on experience with Foxit's PDF Services (extraction/OCR) and Document Generation APIs, and see how event sourcing turns AI decisions into an auditable, replayable ledger.

We'll walk through a real-world HR use case: Resume → AI Analysis → Candidate Report PDF. We'll extract information from a candidate's resume, evaluate it under a policy, generate a structured HR report, and log each step as an event.

Objectives

By the end of this workshop, you will:

Audience

Developers, DevOps/Platform engineers, solutions architects, and technical managers interested in real-world applications of APIs for document automation and workflow orchestration.

Prerequisites

1) Install dependencies

python -V
# virtual environment setup, requests installation
python3 -m venv myenv
source myenv/bin/activate
pip3 install requests

2) Download the project's zip file below

Project Source Code

Now extract the files somewhere in your computer, open in Visual Studio Code or your preferred IDE.

You may use any sample resume PDF for inputs/input_resume.pdf. A sample one is provided, but you may leverage any resume PDF you wish to generate a report on!

3) Create a Foxit Account for credentials

Navigate to our getting started guide which will go over how to create a free trial.

You will find a tutorial page with the following:

API Flowchart

Step 1 — Open the workshop source code

Now that you've downloaded the workshop source code, navigat to the resume_to_report.py file which will serve as our main entrypoint.

python3 resume_to_report.py

You should see:

Step 2 — Inspect the outputs

  1. Open outputs/HR_Report.pdf to review:
    • Candidate name and phone
    • Overall fit score
    • Matching skills & gaps
    • Summary, trace ID, and policy reference in the footer
  2. Open outputs/events.jsonl; each line is a JSON event, e.g.:
{
  "eventType": "DecisionProposed",
  "traceId": "8d1e4df6-8ac9-4f31-9b3a-841d715c2b1c",
  "payload": {
    "fitScore": 82,
    "policyRef": "EvaluationPolicy#v1.0"
  }
}

This is your audit trail.

Step 3 — Replay & Explain (policy change)

Replay demonstrates why event-sourcing matters:

  1. Edit inputs/evaluation_policy.json: add a hard requirement (e.g., "kubernetes") or adjust the job_description emphasis.
  2. Re-run the script with the same resume.
  3. Compare:
    • New decision and updated PDF content
    • Event log now reflects the updated rationale (PolicyLoaded snapshot → new DecisionProposed with the same traceId lineage)
  4. Emphasize: The input resume hasn't changed; only policy did — the event ledger explains the difference.

The AI analysis is policy-driven. A JSON policy file instructs the agent how to score, cap, and summarize. Changing the policy yields different outcomes on the same resume — and every policy snapshot is logged as an event.

Create inputs/evaluation_policy.json:

{
  "policyId": "EvaluationPolicy#v1.0",
  "job_description": "Looking for a software engineer with expertise in C++, Python, and AWS cloud services. Experience building scalable applications in agile teams; familiarity with DevOps and CI/CD.",
  "overall_summary": "Make the summary as short as possible",
  "hard_requirements": ["C++", "python", "aws"]
}

Notes:

Open inputs/hr_report_template.docx, you will find the following HR reporting template with placeholders for the fields we will be entering:

API Flowchart

Tips:

sample-report-output-1sample-report-output-2