Multi-stage literature pipeline
Run a five-stage literature pipeline — query to comparison table
This pipeline takes a research question and returns a formatted Markdown comparison table of papers — title, year, method, key finding, and limitation. Fully automated from query to structured output.
- Go to Downloads (curriculum.32dots.de/share) and download 'Session 8 — Multi-stage literature pipeline'.
- In n8n: ⋯ → Import from file. Open the chat panel.
- Type: 'mTOR inhibitor resistance mechanisms in breast cancer'.
- Wait — the pipeline runs 5 stages (watch the execution log on the right as each node lights up).
- Read the Markdown table in the response. Check: does the AI correctly identify methods and limitations?
- Run again with your own research topic.
- Click into the 'Stage 3 — AI Extract' node in the execution log. Read the raw JSON it returned.
Five-stage pipeline design
Open the canvas. Each stage has a single, testable responsibility. A well-designed pipeline makes it obvious where something went wrong — you can run any stage in isolation to debug it.
Probe-Fragen
- What happens if the AI returns slightly malformed JSON in Stage 3? Open the Code node and find where this is handled.
- The extraction prompt asks for 5 fields. What happens if an abstract does not mention methodology? Is the result filtered out?
- How would you extend Stage 5 to also produce a BibTeX citation file alongside the Markdown table?
Add a sixth stage: citation counts
Extend the pipeline to retrieve citation counts from Semantic Scholar for each paper.
Aufgabe: After Stage 2 (Fetch), add a Semantic Scholar API call that retrieves citation counts, then incorporate them into the Stage 5 table.
- After Stage 2 — Fetch (PubMed efetch), add an HTTP Request: GET https://api.semanticscholar.org/graph/v1/paper/PMID:{pmid}?fields=citationCount — start with one PMID ($('Stage 2 — Fetch').first().json.ids.split(',')[0]).
- Add a Set node that extracts citationCount and passes it forward alongside the abstracts.
- Update the Stage 3 AI Extract system prompt: add a 'citations' field to the requested JSON (pass the count as context).
- Update the Stage 4+5 Code node to include a Citations column in the Markdown table.
- Test with a well-known paper. Does the count match Google Scholar?
- Test with a paper from 2024. What happens when citation data is not yet available?
Hast du das verstanden?
- I can describe all five stages and the single responsibility of each.
- I understand how the Code node handles malformed AI JSON output (Stage 4+5).
- I added a sixth API call and integrated its data into the final table.
Frag den Tutor zu dieser Karte
Sokratisch: der Tutor antwortet mit Leitfragen statt fertigen Antworten — du erarbeitest die Lösung selbst.
Stell eine erste Frage zu dieser Karte unten.