Saltar al contenido

Automatización de Boletín de Mercado para HNW

Automatiza la creación de un boletín semanal de mercado para clientes de alto patrimonio. Utiliza IA para investigar, generar contenido, realizar control de calidad y gestionar un ciclo de aprobación/revisión con envío vía Gmail.

TempuraAIn8n 27 nodos 9 tipos conectado
Cargando workflow...

Nodos

ScheduleTrigger Code Gmail RespondToWebhook Perplexity OpenAi Webhook If StickyNote

Herramientas

Perplexity OpenAI Gmail

Detalles

ID
9314
Nodos
27
Conex.
Tipos
9

Pertenece a:

¿Qué hace este workflow?

Este workflow avanzado está diseñado para automatizar completamente la creación y distribución de un boletín de mercado semanal, especialmente dirigido a clientes de alto patrimonio (HNW). Utiliza capacidades de inteligencia artificial para investigar tendencias, generar contenido relevante y realizar un control de calidad exhaustivo, asegurando que cada boletín sea preciso y de alta calidad. El proceso incluye un sofisticado ciclo de aprobación y revisión, permitiendo a los editores humanos intervenir y refinar el contenido antes de su envío final a través de Gmail. Ideal para empresas de servicios profesionales o gestión de patrimonios que buscan mantener una comunicación constante y de alto valor con sus clientes VIP, liberando recursos del equipo de marketing y editorial. Elimina tareas manuales repetitivas, reduce significativamente los tiempos de producción y garantiza una estrategia de comunicación proactiva y consistente.

¿Cómo funciona?

Este workflow usa 27 nodos conectados con 9 tipos diferentes: ScheduleTrigger, Code, Gmail, RespondToWebhook, Perplexity y 4 más. La estructura está totalmente conectada — listo para importar.

¿Para quién es?

Diseñado para empresas de Servicios Profesionales y equipos de Marketing & Email. Nivel avanzado — recomendado para usuarios experimentados. Alto valor de negocio: automatiza una tarea recurrente con impacto directo.

¿Lo quieres en tu empresa?

Lo implementamos por ti end-to-end: integración, deploy, mantenimiento y soporte. Consultoría B2B con Genai Sapiens.

Hablemos de tu proyecto

¿Quieres aprender a hacerlo?

Sprints de 30 días con companion IA + comunidad. Aprende n8n, automatización y agentes IA desde cero o nivel avanzado.

Ver formación Momentum

Workflows similares

\n\n`;\n})()\n}}\n"},"typeVersion":1.4,"alwaysOutputData":true},{"id":"b1d7e9ac-aac7-4991-95a2-969eed35e16f","name":"Enrich for Editorial","type":"n8n-nodes-base.code","position":[-2368,-352],"parameters":{"jsCode":"const src = $json; // output of Parse Perplexity JSON\nconst week = $node[\"Week ranges + run_key\"].json.week_label;\nconst runKey = $node[\"Week ranges + run_key\"].json.run_key || String(Date.now());\n\nreturn [{\n json: {\n ...src,\n\n // Values the Editorial LLM should see & use in the HTML it generates:\n week_label: week,\n firm_name: \"Company Name\",\n contact_url: \"contact url\",\n view_url: `https://website/${runKey}`,\n year: new Date().getFullYear()\n }\n}];\n"},"typeVersion":2,"alwaysOutputData":true},{"id":"578406b0-c63f-4189-916a-4c25c04ab62e","name":"Research LLM","type":"n8n-nodes-base.perplexity","position":[-2816,-352],"parameters":{"options":{"topP":1,"maxTokens":4000,"temperature":0.2},"messages":{"message":[{"role":"system","content":"=You are a buy-side markets researcher for high-net-worth clients. Your job is to collect and synthesize weekly market facts (prices, % moves, yields, credible headlines) and return ONE STRICT JSON object only.\n\nHARD RULES\n- Output ONE valid JSON object. No prose, no markdown, no code fences.\n- Use the provided ISO window as the only reference period (official closes only; no intraday).\n- Prefer primary sources and tier-1 outlets only: index providers (S&P, Nasdaq, FTSE, STOXX, MSCI), exchanges, central banks, Treasury/FRED/ONS/Eurostat, IMF/World Bank, and Reuters/FT/WSJ/Bloomberg.\n- Exclude minor markets and assets unless they have moved enough to affect a typical multi-asset institutional portfolio or shifted global risk sentiment.\n- Every numeric row should include ≥1 source; important rows should include ≥2.\n- Be neutral; do not speculate or predict.\n- If something can't be corroborated, omit it (do not invent placeholders).\n\nCOVERAGE SCOPE (weekly closes; w/w = this week close vs last week close; YTD vs prior year end)\n\nINDICES (≥15 mixed regions with sector breakdown):\n- US: S&P 500, Nasdaq Composite, Dow Jones, Russell 2000, Russell 1000 Growth, Russell 1000 Value\n- Europe: STOXX Europe 600, FTSE 100, DAX 30, CAC 40, FTSE MIB, IBEX 35\n- Asia-Pacific: Nikkei 225, Hang Seng, CSI 300, KOSPI, ASX 200, Nifty 50\n- Global: MSCI World, MSCI Emerging Markets, MSCI ACWI\n- Include weekly high/low ranges where available\n- Do not include regional indices, currencies, or commodities outside the defined list unless their weekly change impacted listed equity, rates, or credit indices.\n\nRATES & CREDIT (yields in %, bps w/w changes):\n- Sovereign: US 3m, 2y, 5y, 10y, 30y; DE 2y, 10y; UK 2y, 10y; JP 2y, 10y; AU 2y, 10y\n- Curves: US 2s10s, 5s30s in bps; term structure analysis\n- Credit: US IG spreads, US HY spreads, EUR IG spreads, EUR HY spreads (bps w/w)\n- Real rates: US 5y5y breakevens, 10y TIPS yields\n\nFX MAJORS (w/w % changes, volatility if available):\n- DXY, EURUSD, USDJPY, GBPUSD, USDCAD, AUDUSD, USDCHF, NZDUSD\n- EM FX: USDCNY, USDBRL, USDMXN, USDINR if relevant to weekly moves\n- Include EM FX and minor commodities only if their volatility or price shift impacts cross-asset flows or ranks as a leading driver cited by two or more tier-1 sources\n\nCOMMODITIES (w/w % changes, technical levels):\n- Energy: WTI Crude, Brent Crude, Natural Gas (US & EU), Gasoline\n- Metals: Gold, Silver, Copper, Platinum, Palladium\n- Agriculture: Wheat, Corn, Soybeans (if significant moves)\n- Include key support/resistance levels where relevant\n- Include EM FX and minor commodities only if their volatility or price shift impacts cross-asset flows or ranks as a leading driver cited by two or more tier-1 sources\n\nVOLATILITY & RISK METRICS:\n- Equity vol: VIX, VXN (Nasdaq vol), VSTOXX, VIX9D\n- Bond vol: MOVE index\n- FX vol: JPY, EUR implied vols if elevated\n- Risk-on/off indicators: High-beta vs low-vol performance\n\nSECTOR PERFORMANCE (S&P GICS Level 1, w/w %):\n- All 11 sectors with specific callouts for top 3 winners/bottom 3 laggards\n- Notable sub-sector moves (banks, semis, REITs, utilities)\n- Style factors: Growth vs Value, Large vs Small cap performance\n\nMARKET BREADTH & TECHNICALS:\n- S&P 500: % above 50dma, 200dma; new highs/lows\n- NYSE: advance/decline ratio, up/down volume\n- Nasdaq: advance/decline, new highs/lows ratio\n- Key technical levels: S&P 500 support/resistance, major moving averages\n\nECONOMIC DATA & EVENTS (with market impact analysis):\n- Central Bank Actions: Fed, ECB, BoJ, BoE decisions or speeches with yield/FX impact\n- Inflation Data: CPI, PCE, Core readings with bond market reaction\n- Employment: NFP, unemployment, wage growth with sector implications\n- Growth Indicators: GDP, PMIs, retail sales with equity sector impact\n- Include actual vs consensus vs prior for key releases\n- Ignore sub-sector or single-stock headlines unless they have driven top-three sector moves in one of the named indices, or been widely cited by tier-1 outlets for shifting market direction.\n\nGEOPOLITICAL & POLICY DEVELOPMENTS:\n- Fed/ECB policy signals and market interpretation\n- Regulatory changes affecting sectors (banks, tech, energy)\n- Trade developments, sanctions, geopolitical tensions\n- Fiscal policy announcements with market-moving potential\n- Only retain topics where the news altered global indices, major sovereign curves, cross-asset correlations, or HNW portfolio risk metrics in that week.\n\nCORPORATE & STRUCTURAL THEMES:\n- Major earnings themes if in earnings season\n- M&A activity affecting sectors or indices\n- Credit events or downgrades affecting spreads\n- Notable IPO/secondary offerings if market-moving\n- avoid smaller markets that have little impact on the portfolio of the clients who will receive the newsletter\n- Only retain topics where the news altered global indices, major sovereign curves, cross-asset correlations, or HNW portfolio risk metrics in that week.\n\nWEEK-AHEAD CALENDAR (6-15 events):\n- Economic releases: exact date, time, consensus, why it matters to markets\n- Central bank events: speeches, minutes, decisions\n- Corporate events: major earnings, ex-dividend dates\n- Policy events: auctions, regulatory announcements\n- Each event must include market relevance and potential portfolio impact\n\nCLIENT PORTFOLIO CONTEXT:\nFor each major theme, include:\n- \"hnw_impact\": How this affects typical 60/40+ portfolios, alternative investments\n- \"positioning_implications\": General themes (duration, quality, diversification, not specific trades)\n- \"risk_level\": low/medium/high for client attention prioritization\n- \"time_horizon\": immediate/tactical (1-3 months)/strategic (6+ months)\n\nRETURN STRICT JSON WITH EXPANDED STRUCTURE:\n\n{\n \"metadata\": {\n \"week_label\": \"Week of [Date] - [Date]\",\n \"window\": { \n \"start_iso\": \"YYYY-MM-DDTHH:mm:ssZ\", \n \"end_iso\": \"YYYY-MM-DDTHH:mm:ssZ\", \n \"tz\": \"America/New_York\" \n },\n \"research_timestamp\": \"YYYY-MM-DDTHH:mm:ssZ\",\n \"primary_themes\": [\"theme1\", \"theme2\", \"theme3\"]\n },\n\n \"equity_indices\": [\n { \n \"name\": \"S&P 500\", \n \"close\": 0, \n \"w_w_pct\": \"+0.0%\", \n \"ytd_pct\": \"+0.0%\", \n \"week_high\": 0,\n \"week_low\": 0,\n \"technical_note\": \"Above/below key MA\",\n \"date\": \"YYYY-MM-DD\", \n \"tz\": \"America/New_York\",\n \"sources\": [ \n { \"publisher\": \"S&P DJI\", \"url\": \"...\" }, \n { \"publisher\": \"Reuters\", \"url\": \"...\" } \n ] \n }\n // Include all 15+ indices with same structure\n ],\n\n \"rates_credit\": {\n \"sovereigns\": [\n { \n \"name\": \"US 10y\", \n \"yield_pct\": 0.00, \n \"w_w_bps\": 0, \n \"ytd_bps\": 0,\n \"technical_level\": \"near resistance/support\",\n \"date\": \"YYYY-MM-DD\", \n \"sources\": [ { \"publisher\": \"U.S. Treasury/FRED\", \"url\": \"...\" } ] \n }\n // Include all major sovereigns\n ],\n \"curves\": [\n { \"name\": \"US 2s10s\", \"spread_bps\": 0, \"w_w_bps\": 0, \"ytd_bps\": 0 },\n { \"name\": \"US 5s30s\", \"spread_bps\": 0, \"w_w_bps\": 0, \"ytd_bps\": 0 }\n ],\n \"credit_spreads\": [\n { \"name\": \"US IG\", \"spread_bps\": 0, \"w_w_bps\": 0, \"ytd_bps\": 0 },\n { \"name\": \"US HY\", \"spread_bps\": 0, \"w_w_bps\": 0, \"ytd_bps\": 0 },\n { \"name\": \"EUR IG\", \"spread_bps\": 0, \"w_w_bps\": 0, \"ytd_bps\": 0 },\n { \"name\": \"EUR HY\", \"spread_bps\": 0, \"w_w_bps\": 0, \"ytd_bps\": 0 }\n ],\n \"real_rates\": [\n { \"name\": \"US 5y5y Breakeven\", \"rate_pct\": 0.00, \"w_w_bps\": 0 },\n { \"name\": \"US 10y TIPS\", \"yield_pct\": 0.00, \"w_w_bps\": 0 }\n ]\n },\n\n \"fx_markets\": [\n { \n \"pair\": \"DXY\", \n \"close\": 0.00, \n \"w_w_pct\": \"+0.0%\", \n \"ytd_pct\": \"+0.0%\",\n \"volatility_note\": \"elevated/normal\",\n \"technical_level\": \"key support/resistance\",\n \"sources\": [ { \"publisher\": \"ICE/Reuters\", \"url\": \"...\" } ] \n }\n // Include all 8+ major pairs\n ],\n\n \"commodities\": [\n { \n \"name\": \"WTI Crude\", \n \"close\": 0.00, \n \"w_w_pct\": \"+0.0%\", \n \"ytd_pct\": \"+0.0%\",\n \"technical_level\": \"$XX support/resistance\",\n \"fundamental_driver\": \"supply/demand factor\",\n \"sources\": [ { \"publisher\": \"EIA/NYMEX\", \"url\": \"...\" } ] \n }\n // Include all major commodities\n ],\n\n \"volatility_risk\": {\n \"equity_vol\": [\n { \"name\": \"VIX\", \"close\": 0.00, \"w_w_pct\": \"+0.0%\", \"regime\": \"low/elevated/high\" },\n { \"name\": \"VXN\", \"close\": 0.00, \"w_w_pct\": \"+0.0%\" }\n ],\n \"bond_vol\": [\n { \"name\": \"MOVE\", \"close\": 0.00, \"w_w_pct\": \"+0.0%\" }\n ],\n \"risk_sentiment\": {\n \"risk_on_off\": \"risk-on/risk-off/mixed\",\n \"quality_spread\": \"IG vs HY spread change\",\n \"defensive_sectors\": \"Utilities, Staples performance vs market\"\n }\n },\n\n \"sector_performance\": [\n { \n \"sector\": \"Information Technology\", \n \"w_w_pct\": \"+0.0%\", \n \"ytd_pct\": \"+0.0%\",\n \"key_drivers\": [\"earnings\", \"rates\", \"regulation\"],\n \"notable_movers\": [\"NVDA weight impact\", \"if relevant\"],\n \"sources\": [ { \"publisher\": \"S&P DJI\", \"url\": \"...\" } ] \n }\n // All 11 GICS sectors\n ],\n\n \"market_breadth\": {\n \"sp500_breadth\": {\n \"pct_above_50dma\": 0,\n \"pct_above_200dma\": 0,\n \"new_highs\": 0,\n \"new_lows\": 0,\n \"weekly_interpretation\": \"broad/narrow participation\"\n },\n \"nyse_data\": {\n \"adv_dec_ratio\": 0.00,\n \"up_vol_pct\": 0,\n \"down_vol_pct\": 0\n },\n \"technical_levels\": {\n \"sp500_support\": 0000,\n \"sp500_resistance\": 0000,\n \"key_moving_averages\": \"50dma, 200dma levels\"\n }\n },\n\n \"economic_calendar_past\": [\n { \n \"date\": \"YYYY-MM-DD\", \n \"time\": \"HH:mm\",\n \"region\": \"US\", \n \"indicator\": \"CPI YoY\", \n \"actual\": \"0.0%\",\n \"consensus\": \"0.0%\",\n \"prior\": \"0.0%\",\n \"market_impact\": \"bond yields rose/fell Xbps\",\n \"portfolio_relevance\": \"supports Fed easing/tightening\",\n \"sources\": [ { \"publisher\": \"BLS\", \"url\": \"...\" } ] \n }\n // 8-15 key releases from the past week\n ],\n\n \"macro_policy_themes\": [\n {\n \"theme\": \"Fed Policy Path\",\n \"development\": \"Powell speech signals dovish pivot\",\n \"market_reaction\": \"10y yields fell 15bps, financials underperformed\",\n \"client_implication\": \"duration extension opportunity\",\n \"time_horizon\": \"tactical\",\n \"sources\": [ { \"publisher\": \"Federal Reserve\", \"url\": \"...\" } ]\n }\n // 3-6 major themes\n ],\n\n \"corporate_structural\": [\n {\n \"theme\": \"Tech Earnings Momentum\",\n \"details\": \"Semiconductor strength drives Nasdaq outperformance\",\n \"sector_impact\": \"IT +2.5% vs S&P +1.2%\",\n \"portfolio_angle\": \"quality growth beneficiary\",\n \"sources\": [ { \"publisher\": \"Bloomberg\", \"url\": \"...\" } ]\n }\n // 2-4 themes if relevant\n ],\n\n \"week_ahead_calendar\": [\n { \n \"date\": \"YYYY-MM-DD\", \n \"time\": \"HH:mm\",\n \"tz\": \"America/New_York\",\n \"region\": \"US\", \n \"event\": \"FOMC Minutes\", \n \"consensus\": \"N/A or expected reading\",\n \"why_matters\": \"Signals December rate cut probability\",\n \"portfolio_impact\": \"Duration and financial sector positioning\",\n \"importance\": \"high/medium/low\",\n \"primary_source_url\": \"federalreserve.gov link if available\" \n }\n // 8-15 events, prioritized by market impact\n ],\n\n \"client_context\": {\n \"week_summary\": {\n \"primary_driver\": \"One sentence on main market driver\",\n \"secondary_driver\": \"One sentence on secondary theme\", \n \"hnw_portfolio_impact\": \"How typical 60/40+ allocation performed\",\n \"risk_level\": \"low/medium/high\",\n \"attention_priority\": \"routine/elevated/urgent\"\n },\n \"positioning_themes\": {\n \"equity\": \"quality bias continues, growth leadership\",\n \"fixed_income\": \"extend duration on dovish Fed\",\n \"alternatives\": \"REITs benefit from rate cuts\",\n \"fx_commodities\": \"dollar weakness supports commodities\"\n },\n \"risk_considerations\": [\n \"Geopolitical tensions remain elevated\",\n \"Credit spreads at tight levels\",\n \"Volatility regime could shift quickly\"\n ]\n },\n\n \"data_quality\": {\n \"coverage_complete\": {\n \"indices\": true,\n \"rates\": true, \n \"fx\": true,\n \"commodities\": true,\n \"volatility\": true,\n \"sectors\": true,\n \"breadth\": true,\n \"economic_data\": true,\n \"calendar\": true\n },\n \"source_tier_distribution\": {\n \"tier_1_pct\": 85,\n \"tier_2_pct\": 15,\n \"total_sources\": 45\n },\n \"missing_data\": [],\n \"research_confidence\": \"high/medium/low\",\n \"core_ok\": true,\n \"ok_to_send\": true\n },\n\n \"kpi_summary_strings\": [\n \"S&P 500 4,622 (+1.2% w/w, +14.6% YTD)\",\n \"Nasdaq Composite 16,000 (+2.5% w/w, +24.2% YTD)\",\n \"US 10y 4.22% (+4bps w/w, +45bps YTD)\",\n \"DXY 103.2 (-0.8% w/w, +2.1% YTD)\",\n \"WTI $73.45 (+2.1% w/w, -8.2% YTD)\",\n \"VIX 14.2 (-2.1pts w/w)\"\n ]\n}\n\nIf any required datapoint is missing or cannot be corroborated from primary sources, add it to data_quality.missing_data and set the corresponding coverage boolean to false. Prioritize accuracy over completeness - omit rather than estimate."},{"content":"=Generate the global market report for the week **{{ $json.week_label }}**, using only official closes between:\n- start: {{ $json.start_iso }}\n- end: {{ $json.end_iso }}\nTimezone: Singapore.\n\nFill every numeric section you can corroborate. Omit anything you cannot validate with tier-1 sources. Compute w/w and YTD (vs prior year end). Return ONE JSON matching the schema in the system prompt.\n"}]},"requestOptions":{}},"credentials":{"perplexityApi":{"id":"m8fgfGwiO0PVWqoh","name":"Perplexity account 2"}},"typeVersion":1,"alwaysOutputData":true},{"id":"77a4ff73-cfc4-4e3e-a832-9be006d0fdeb","name":"QC LLM","type":"@n8n/n8n-nodes-langchain.openAi","position":[-1616,-256],"parameters":{"modelId":{"__rl":true,"mode":"list","value":"gpt-3.5-turbo","cachedResultName":"GPT-3.5-TURBO"},"options":{"maxTokens":1000,"temperature":0},"messages":{"values":[{"role":"system","content":"=You are “QC”—a deterministic, conservative validator for a weekly client newsletter at a $50B private wealth firm.\n\nScope:\n1) FACT-CHECK the draft’s claims against the supplied research JSON.\n2) COMPLIANCE SCAN for risky language (promissory, specific advice, guarantees, allocations).\n3) THEME Reject any draft where more than 5% of the content covers assets, events, or regions that are not part of an average institutional/RIA client's multi-asset portfolio.\n\nDecision rules:\n- Flag ONLY what you can point to explicitly in the draft.\n- Be conservative: better to flag than miss.\n- Never rewrite the newsletter—just report issues.\n\nOutput: A single JSON object **exactly** in this schema (no extra text):\n{\n \"material_issue\": boolean, // true if any high-severity fact or comp issue\n \"facts\": [\n {\n \"severity\": \"low|medium|high\",\n \"where\": \"section/heading or CSS selector or short quote\",\n \"claim\": \"verbatim or tight paraphrase of the draft claim\",\n \"reason\": \"why it’s wrong/unsupported/overstated\",\n \"evidence\": \"numbers/dates from research JSON that contradict or fail to support\",\n \"fix\": \"plain-language correction suggestion\"\n }\n ],\n \"compliance\": [\n {\n \"severity\": \"low|medium|high\",\n \"where\": \"section/heading or short quote\",\n \"issue\": \"promissory language / specific advice / guarantee / allocation / performance claim / other\",\n \"snippet\": \"verbatim risky wording\",\n \"policy\": \"short label of the violated guardrail\",\n \"fix\": \"safer phrasing or removal guidance\"\n }\n ],\n \"notes\": [\n \"optional short observations to help the editor (never prescriptive rewriting)\"\n ]\n}\n\nSeverity guidance:\n- high = could mislead on facts or breach core compliance.\n- medium= material nuance missing; could be misread by clients.\n- low = wording tone or minor precision issue.\n"},{"content":"=WEEK_CONTEXT:\n{{\n JSON.stringify({\n start_iso: $json.week_meta?.start_iso || $json.start_iso || \"\",\n end_iso: $json.week_meta?.end_iso || $json.end_iso || \"\",\n week_label: $json.week_meta?.week_label || $json.week_label || \"\"\n })\n}}\n\nDRAFT_HTML:\n{{\n (() => {\n let html = ($json.html || \"\").toString();\n // keep QC fast: drop scripts/styles and cap length\n html = html.replace(//gi, \"\")\n .replace(//gi, \"\");\n return html.length > 30000 ? html.slice(0, 30000) : html;\n })()\n}}\n\nRESEARCH_JSON:\n{{\n (() => {\n // If you already attach a compact research object in context, use it directly.\n const r = $json.research || {};\n // Optional: if r can be huge, pick only needed keys:\n // const slim = { equities: r.equities, rates: r.rates, fx: r.fx, notes: r.notes };\n const s = JSON.stringify(r);\n return s.length > 30000 ? s.slice(0, 30000) : s;\n })()\n}}\n\n\nINSTRUCTIONS:\n- Compare DRAFT_HTML against RESEARCH_JSON using WEEK_CONTEXT for dates.\n- If RESEARCH_JSON is empty, skip factual checks and only run compliance checks; set notes = \"facts_skipped_no_research\".\n- Match numeric values exactly (including %/bps). If rounding differs but clearly references the same RESEARCH number, mark \"medium\" and suggest rounding to one decimal (or bps for yields).\n- Flag any dates not equal to WEEK_CONTEXT (including YEAR).\n- Focus only on issues that matter for institutional communications.\n\nReturn ONLY the JSON object specified in the system message.\n"}]},"simplify":false,"jsonOutput":true},"credentials":{"openAiApi":{"id":"gKuBN54EYmj7LkOE","name":"OpenAi account 2"}},"typeVersion":1.8,"alwaysOutputData":true},{"id":"9a9426ae-4678-4e06-9126-bf090b1acffe","name":"HTML Builder LLM","type":"@n8n/n8n-nodes-langchain.openAi","position":[-1888,-256],"parameters":{"modelId":{"__rl":true,"mode":"list","value":"gpt-3.5-turbo","cachedResultName":"GPT-3.5-TURBO"},"options":{"maxTokens":4000,"temperature":0.2},"messages":{"values":[{"role":"system","content":"=You are “HTML Builder”. Input: the editor JSON above. Output: ONE JSON:\n{ \"subject\": string, \"html\": string }\n\nRENDERING RULES\"\n- Headline: render ONLY

{{ $json.message.content.newsletter_content.headline }}

.\n- Do NOT render newsletter_content.subheader anywhere in the HTML body.\n- (Subject logic unchanged.)\n- Subject: use newsletter_content.subject if present; otherwise \"Weekly Markets — \" + newsletter_content.subheader. {{ $json.message.content.newsletter_content.subject_options }} and {{ $json.message.content.newsletter_content.headline }} need to be consistent\n\nHTML STRUCTURE:\n- Full HTML document () with and responsive meta.\n- Container: max-width 720px; centered; 24px page padding.\n- Typography: -apple-system, Segoe UI, Roboto, Arial, sans-serif; base 16px; line-height ~1.55.\n- Palette: #111 text; #555 secondary; dividers #e6e6e9; subtle background #f6f7fb; link #2d6cdf.\n- Sections in this exact order & labels (the order MUST be respected):\n 1) Author Note → newsletter_content.sections.author_note_html\n 2) Weekly Markets Summary → newsletter_content.sections.market_summary_html\n 3) Deeper Dive → newsletter_content.sections.deep_dive_html\n 4) What to Expect Next Week → newsletter_content.sections.next_week_html\n 5) Sources → newsletter_content.sections.sources_html\n 6) Disclaimers → newsletter_content.sections.disclaimer_html\n 7) Signature → signature_html\n\nSTYLE: \n- use

/

, 24–28px spacing, 1px dividers (#e6e6e9), bullet lists where provided. Avoid large data tables unless supplied by the editor (next_week table is expected).\n- Sanitize/escape untrusted inputs; no inline JS; no external assets.\n\nTABLES (EMAIL-SAFE — use THIS exact markup for “What to Expect Next Week”)\n- Emit pure HTML with INLINE styles only. No Markdown tables. No