{"product_id":"krayin-crm-lead-sync-from-external-purchase-data-n8n-workflow","title":"Krayin CRM Lead Sync from External Purchase Data (n8n Workflow)","description":"\u003ch3\u003eKrayin CRM Lead Sync: Automatically push external lead + purchase events into the right pipeline and stage\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow receives lead and purchase data from another automation, finds (or creates) the contact in \u003cstrong\u003eKrayin CRM\u003c\/strong\u003e, and then creates or updates the corresponding lead—placing it in the correct \u003cstrong\u003epipeline (Funil)\u003c\/strong\u003e and \u003cstrong\u003estage (Stage)\u003c\/strong\u003e with the related product and transaction details.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReceives lead details\u003c\/strong\u003e (name, email, phone, product, value, pipeline, stage, offer code, transaction ID, and status) from another n8n workflow.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eResolves the target pipeline + stage\u003c\/strong\u003e by matching the incoming pipeline name (\u003cem\u003eFunil\u003c\/em\u003e) and stage name (\u003cem\u003eStage\u003c\/em\u003e) to existing records in Krayin CRM.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eFinds or creates a contact\u003c\/strong\u003e in Krayin CRM using the customer’s email.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eFinds an existing lead\u003c\/strong\u003e for that contact within the selected pipeline.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eChecks for the incoming product SKU\u003c\/strong\u003e: if the existing lead already includes the incoming product, it updates the lead to a fixed stage ID (hard-coded as \u003cstrong\u003e19\u003c\/strong\u003e).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eOtherwise adds\/updates the product on the lead\u003c\/strong\u003e:\n    \u003cul\u003e\n      \u003cli\u003eFetches the product in Krayin CRM by \u003cstrong\u003eoffer code (Oferta_code)\u003c\/strong\u003e.\u003c\/li\u003e\n      \u003cli\u003eCreates a new lead (or updates the existing one) to attach the product.\u003c\/li\u003e\n      \u003cli\u003eSets lead custom attributes including \u003cstrong\u003ehotmart_status\u003c\/strong\u003e and \u003cstrong\u003ehotmart_transaction_id\u003c\/strong\u003e.\u003c\/li\u003e\n    \u003c\/ul\u003e\n  \u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eSync Hotmart-style purchase events into Krayin CRM so sales teams see the correct product + transaction details on the lead.\u003c\/li\u003e\n  \u003cli\u003eKeep leads up to date when the same customer purchases an additional SKU (update stage if the product already exists).\u003c\/li\u003e\n  \u003cli\u003eRoute leads automatically to the intended pipeline\/stage using the pipeline and stage names provided by your upstream workflow.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eKrayin CRM credential + API access\u003c\/strong\u003e for lead\/contact lookup and lead updates.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ec u s t o mkrayin\u003c\/strong\u003e node(s) for Krayin CRM operations.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eif\u003c\/strong\u003e logic to decide whether to update stage vs. add\/create the product on the lead.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eexecute workflow trigger\u003c\/strong\u003e to receive the external lead\/purchase payload from another n8n workflow.\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003e\u003cstrong\u003eSetup notes:\u003c\/strong\u003e Ensure the incoming \u003cem\u003eFunil\u003c\/em\u003e and \u003cem\u003eStage\u003c\/em\u003e names match Krayin CRM records, verify \u003cem\u003eOferta_code\u003c\/em\u003e maps to a Krayin product, confirm the custom attribute codes \u003cstrong\u003ehotmart_status\u003c\/strong\u003e and \u003cstrong\u003ehotmart_transaction_id\u003c\/strong\u003e exist on leads, and update the hard-coded stage ID (\u003cstrong\u003e19\u003c\/strong\u003e) to your environment.\u003c\/p\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45978886308019,"sku":"N8N-19371","price":36.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/oDikkuL8PNJAVVJ4m4cUb_Np7glxxW.png?v=1788858322","url":"https:\/\/buyflowscripts.com\/products\/krayin-crm-lead-sync-from-external-purchase-data-n8n-workflow","provider":"N8N Commerce","version":"1.0","type":"link"}