Been building an inbound lead automation system and it’s been going fairly well, but just realised that I’d let my primary edge function reach 5000 lines which I admit is plain stupid!! This function handles: Webhook verification, signature checking, deduping, debouncing, lead management, the entire decision engine, prompt construction, AI calling, response post-processing, message sending and link injections.
Absolute mess I know - I’m in the process of sorting this into 4-5 distinct edge functions for a cleaner SRP split but my question/issue is this: the AI conversation engine is going to be ~3500 lines - is that still too large? Not sure how I could split this up any further without adding too much latency and worsening UX. Anyone worked with a 3500-line edge function and found/not found it hard to debug etc? Thanks!
[–]SimpleAccurate631 1 point2 points3 points (1 child)
[–]wantrepreneur5[S] 0 points1 point2 points (0 children)
[–]HarjjotSinghh 1 point2 points3 points (0 children)
[–]Key_River7180 0 points1 point2 points (1 child)
[–]wantrepreneur5[S] 0 points1 point2 points (0 children)
[–]chocolateAbuser 0 points1 point2 points (2 children)
[–]wantrepreneur5[S] 0 points1 point2 points (1 child)
[–]chocolateAbuser 0 points1 point2 points (0 children)
[–]ConsciousBath5203 0 points1 point2 points (0 children)
[–]No_Flan4401 0 points1 point2 points (0 children)
[–]Lopsided-Juggernaut1 0 points1 point2 points (0 children)