cocoon icon

Cocoon: Transforming Large-Scale Data

We enable Gen AI to understand your large data and pipelines, providing a chat interface for transformation:

Get Started with Notebook

The project is fully open-sourced. You can run Cocoon locally.

Try Cocoon

Live Demo: RAG Hubspot (Pipelines) + Salesforce (Tables)


Step 1: Prepare RAG for Pipelines + Tables

Instead of traditional Vector RAG, Cocoon builds novel RAG based on pipeline lineage and join graph.

1. Hubspot DBT Data Pipeline

%3 1. model.hubspot_source.stg_hubspot__company_property_history_tmp_0 1. model.hubspot_source.stg_hubspot__company_property_history_tmp 40. model.hubspot_source.stg_hubspot__company_property_history_39 40. model.hubspot_source.stg_hubspot__company_property_history 1. model.hubspot_source.stg_hubspot__company_property_history_tmp_0->40. model.hubspot_source.stg_hubspot__company_property_history_39 2. model.hubspot_source.stg_hubspot__company_tmp_1 2. model.hubspot_source.stg_hubspot__company_tmp 39. model.hubspot_source.stg_hubspot__company_38 39. model.hubspot_source.stg_hubspot__company 2. model.hubspot_source.stg_hubspot__company_tmp_1->39. model.hubspot_source.stg_hubspot__company_38 3. model.hubspot_source.stg_hubspot__contact_list_member_tmp_2 3. model.hubspot_source.stg_hubspot__contact_list_member_tmp 43. model.hubspot_source.stg_hubspot__contact_list_member_42 43. model.hubspot_source.stg_hubspot__contact_list_member 3. model.hubspot_source.stg_hubspot__contact_list_member_tmp_2->43. model.hubspot_source.stg_hubspot__contact_list_member_42 4. model.hubspot_source.stg_hubspot__contact_list_tmp_3 4. model.hubspot_source.stg_hubspot__contact_list_tmp 42. model.hubspot_source.stg_hubspot__contact_list_41 42. model.hubspot_source.stg_hubspot__contact_list 4. model.hubspot_source.stg_hubspot__contact_list_tmp_3->42. model.hubspot_source.stg_hubspot__contact_list_41 5. model.hubspot_source.stg_hubspot__contact_property_history_tmp_4 5. model.hubspot_source.stg_hubspot__contact_property_history_tmp 44. model.hubspot_source.stg_hubspot__contact_property_history_43 44. model.hubspot_source.stg_hubspot__contact_property_history 5. model.hubspot_source.stg_hubspot__contact_property_history_tmp_4->44. model.hubspot_source.stg_hubspot__contact_property_history_43 6. model.hubspot_source.stg_hubspot__contact_tmp_5 6. model.hubspot_source.stg_hubspot__contact_tmp 41. model.hubspot_source.stg_hubspot__contact_40 41. model.hubspot_source.stg_hubspot__contact 6. model.hubspot_source.stg_hubspot__contact_tmp_5->41. model.hubspot_source.stg_hubspot__contact_40 7. model.hubspot_source.stg_hubspot__deal_company_tmp_6 7. model.hubspot_source.stg_hubspot__deal_company_tmp 46. model.hubspot_source.stg_hubspot__deal_company_45 46. model.hubspot_source.stg_hubspot__deal_company 7. model.hubspot_source.stg_hubspot__deal_company_tmp_6->46. model.hubspot_source.stg_hubspot__deal_company_45 8. model.hubspot_source.stg_hubspot__deal_contact_tmp_7 8. model.hubspot_source.stg_hubspot__deal_contact_tmp 47. model.hubspot_source.stg_hubspot__deal_contact_46 47. model.hubspot_source.stg_hubspot__deal_contact 8. model.hubspot_source.stg_hubspot__deal_contact_tmp_7->47. model.hubspot_source.stg_hubspot__deal_contact_46 9. model.hubspot_source.stg_hubspot__deal_pipeline_stage_tmp_8 9. model.hubspot_source.stg_hubspot__deal_pipeline_stage_tmp 49. model.hubspot_source.stg_hubspot__deal_pipeline_stage_48 49. model.hubspot_source.stg_hubspot__deal_pipeline_stage 9. model.hubspot_source.stg_hubspot__deal_pipeline_stage_tmp_8->49. model.hubspot_source.stg_hubspot__deal_pipeline_stage_48 10. model.hubspot_source.stg_hubspot__deal_pipeline_tmp_9 10. model.hubspot_source.stg_hubspot__deal_pipeline_tmp 48. model.hubspot_source.stg_hubspot__deal_pipeline_47 48. model.hubspot_source.stg_hubspot__deal_pipeline 10. model.hubspot_source.stg_hubspot__deal_pipeline_tmp_9->48. model.hubspot_source.stg_hubspot__deal_pipeline_47 11. model.hubspot_source.stg_hubspot__deal_property_history_tmp_10 11. model.hubspot_source.stg_hubspot__deal_property_history_tmp 50. model.hubspot_source.stg_hubspot__deal_property_history_49 50. model.hubspot_source.stg_hubspot__deal_property_history 11. model.hubspot_source.stg_hubspot__deal_property_history_tmp_10->50. model.hubspot_source.stg_hubspot__deal_property_history_49 12. model.hubspot_source.stg_hubspot__deal_stage_tmp_11 12. model.hubspot_source.stg_hubspot__deal_stage_tmp 51. model.hubspot_source.stg_hubspot__deal_stage_50 51. model.hubspot_source.stg_hubspot__deal_stage 12. model.hubspot_source.stg_hubspot__deal_stage_tmp_11->51. model.hubspot_source.stg_hubspot__deal_stage_50 13. model.hubspot_source.stg_hubspot__deal_tmp_12 13. model.hubspot_source.stg_hubspot__deal_tmp 45. model.hubspot_source.stg_hubspot__deal_44 45. model.hubspot_source.stg_hubspot__deal 13. model.hubspot_source.stg_hubspot__deal_tmp_12->45. model.hubspot_source.stg_hubspot__deal_44 14. model.hubspot_source.stg_hubspot__email_campaign_tmp_13 14. model.hubspot_source.stg_hubspot__email_campaign_tmp 52. model.hubspot_source.stg_hubspot__email_campaign_51 52. model.hubspot_source.stg_hubspot__email_campaign 14. model.hubspot_source.stg_hubspot__email_campaign_tmp_13->52. model.hubspot_source.stg_hubspot__email_campaign_51 15. model.hubspot_source.stg_hubspot__email_event_bounce_tmp_14 15. model.hubspot_source.stg_hubspot__email_event_bounce_tmp 54. model.hubspot_source.stg_hubspot__email_event_bounce_53 54. model.hubspot_source.stg_hubspot__email_event_bounce 15. model.hubspot_source.stg_hubspot__email_event_bounce_tmp_14->54. model.hubspot_source.stg_hubspot__email_event_bounce_53 16. model.hubspot_source.stg_hubspot__email_event_click_tmp_15 16. model.hubspot_source.stg_hubspot__email_event_click_tmp 55. model.hubspot_source.stg_hubspot__email_event_click_54 55. model.hubspot_source.stg_hubspot__email_event_click 16. model.hubspot_source.stg_hubspot__email_event_click_tmp_15->55. model.hubspot_source.stg_hubspot__email_event_click_54 17. model.hubspot_source.stg_hubspot__email_event_deferred_tmp_16 17. model.hubspot_source.stg_hubspot__email_event_deferred_tmp 56. model.hubspot_source.stg_hubspot__email_event_deferred_55 56. model.hubspot_source.stg_hubspot__email_event_deferred 17. model.hubspot_source.stg_hubspot__email_event_deferred_tmp_16->56. model.hubspot_source.stg_hubspot__email_event_deferred_55 18. model.hubspot_source.stg_hubspot__email_event_delivered_tmp_17 18. model.hubspot_source.stg_hubspot__email_event_delivered_tmp 57. model.hubspot_source.stg_hubspot__email_event_delivered_56 57. model.hubspot_source.stg_hubspot__email_event_delivered 18. model.hubspot_source.stg_hubspot__email_event_delivered_tmp_17->57. model.hubspot_source.stg_hubspot__email_event_delivered_56 19. model.hubspot_source.stg_hubspot__email_event_dropped_tmp_18 19. model.hubspot_source.stg_hubspot__email_event_dropped_tmp 58. model.hubspot_source.stg_hubspot__email_event_dropped_57 58. model.hubspot_source.stg_hubspot__email_event_dropped 19. model.hubspot_source.stg_hubspot__email_event_dropped_tmp_18->58. model.hubspot_source.stg_hubspot__email_event_dropped_57 20. model.hubspot_source.stg_hubspot__email_event_forward_tmp_19 20. model.hubspot_source.stg_hubspot__email_event_forward_tmp 59. model.hubspot_source.stg_hubspot__email_event_forward_58 59. model.hubspot_source.stg_hubspot__email_event_forward 20. model.hubspot_source.stg_hubspot__email_event_forward_tmp_19->59. model.hubspot_source.stg_hubspot__email_event_forward_58 21. model.hubspot_source.stg_hubspot__email_event_open_tmp_20 21. model.hubspot_source.stg_hubspot__email_event_open_tmp 60. model.hubspot_source.stg_hubspot__email_event_open_59 60. model.hubspot_source.stg_hubspot__email_event_open 21. model.hubspot_source.stg_hubspot__email_event_open_tmp_20->60. model.hubspot_source.stg_hubspot__email_event_open_59 22. model.hubspot_source.stg_hubspot__email_event_print_tmp_21 22. model.hubspot_source.stg_hubspot__email_event_print_tmp 61. model.hubspot_source.stg_hubspot__email_event_print_60 61. model.hubspot_source.stg_hubspot__email_event_print 22. model.hubspot_source.stg_hubspot__email_event_print_tmp_21->61. model.hubspot_source.stg_hubspot__email_event_print_60 23. model.hubspot_source.stg_hubspot__email_event_sent_tmp_22 23. model.hubspot_source.stg_hubspot__email_event_sent_tmp 62. model.hubspot_source.stg_hubspot__email_event_sent_61 62. model.hubspot_source.stg_hubspot__email_event_sent 23. model.hubspot_source.stg_hubspot__email_event_sent_tmp_22->62. model.hubspot_source.stg_hubspot__email_event_sent_61 24. model.hubspot_source.stg_hubspot__email_event_spam_report_tmp_23 24. model.hubspot_source.stg_hubspot__email_event_spam_report_tmp 63. model.hubspot_source.stg_hubspot__email_event_spam_report_62 63. model.hubspot_source.stg_hubspot__email_event_spam_report 24. model.hubspot_source.stg_hubspot__email_event_spam_report_tmp_23->63. model.hubspot_source.stg_hubspot__email_event_spam_report_62 25. model.hubspot_source.stg_hubspot__email_event_status_change_tmp_24 25. model.hubspot_source.stg_hubspot__email_event_status_change_tmp 64. model.hubspot_source.stg_hubspot__email_event_status_change_63 64. model.hubspot_source.stg_hubspot__email_event_status_change 25. model.hubspot_source.stg_hubspot__email_event_status_change_tmp_24->64. model.hubspot_source.stg_hubspot__email_event_status_change_63 26. model.hubspot_source.stg_hubspot__email_event_tmp_25 26. model.hubspot_source.stg_hubspot__email_event_tmp 53. model.hubspot_source.stg_hubspot__email_event_52 53. model.hubspot_source.stg_hubspot__email_event 26. model.hubspot_source.stg_hubspot__email_event_tmp_25->53. model.hubspot_source.stg_hubspot__email_event_52 27. model.hubspot_source.stg_hubspot__engagement_call_tmp_26 27. model.hubspot_source.stg_hubspot__engagement_call_tmp 66. model.hubspot_source.stg_hubspot__engagement_call_65 66. model.hubspot_source.stg_hubspot__engagement_call 27. model.hubspot_source.stg_hubspot__engagement_call_tmp_26->66. model.hubspot_source.stg_hubspot__engagement_call_65 28. model.hubspot_source.stg_hubspot__engagement_company_tmp_27 28. model.hubspot_source.stg_hubspot__engagement_company_tmp 67. model.hubspot_source.stg_hubspot__engagement_company_66 67. model.hubspot_source.stg_hubspot__engagement_company 28. model.hubspot_source.stg_hubspot__engagement_company_tmp_27->67. model.hubspot_source.stg_hubspot__engagement_company_66 29. model.hubspot_source.stg_hubspot__engagement_contact_tmp_28 29. model.hubspot_source.stg_hubspot__engagement_contact_tmp 68. model.hubspot_source.stg_hubspot__engagement_contact_67 68. model.hubspot_source.stg_hubspot__engagement_contact 29. model.hubspot_source.stg_hubspot__engagement_contact_tmp_28->68. model.hubspot_source.stg_hubspot__engagement_contact_67 30. model.hubspot_source.stg_hubspot__engagement_deal_tmp_29 30. model.hubspot_source.stg_hubspot__engagement_deal_tmp 69. model.hubspot_source.stg_hubspot__engagement_deal_68 69. model.hubspot_source.stg_hubspot__engagement_deal 30. model.hubspot_source.stg_hubspot__engagement_deal_tmp_29->69. model.hubspot_source.stg_hubspot__engagement_deal_68 31. model.hubspot_source.stg_hubspot__engagement_email_tmp_30 31. model.hubspot_source.stg_hubspot__engagement_email_tmp 70. model.hubspot_source.stg_hubspot__engagement_email_69 70. model.hubspot_source.stg_hubspot__engagement_email 31. model.hubspot_source.stg_hubspot__engagement_email_tmp_30->70. model.hubspot_source.stg_hubspot__engagement_email_69 32. model.hubspot_source.stg_hubspot__engagement_meeting_tmp_31 32. model.hubspot_source.stg_hubspot__engagement_meeting_tmp 71. model.hubspot_source.stg_hubspot__engagement_meeting_70 71. model.hubspot_source.stg_hubspot__engagement_meeting 32. model.hubspot_source.stg_hubspot__engagement_meeting_tmp_31->71. model.hubspot_source.stg_hubspot__engagement_meeting_70 33. model.hubspot_source.stg_hubspot__engagement_note_tmp_32 33. model.hubspot_source.stg_hubspot__engagement_note_tmp 72. model.hubspot_source.stg_hubspot__engagement_note_71 72. model.hubspot_source.stg_hubspot__engagement_note 33. model.hubspot_source.stg_hubspot__engagement_note_tmp_32->72. model.hubspot_source.stg_hubspot__engagement_note_71 34. model.hubspot_source.stg_hubspot__engagement_task_tmp_33 34. model.hubspot_source.stg_hubspot__engagement_task_tmp 73. model.hubspot_source.stg_hubspot__engagement_task_72 73. model.hubspot_source.stg_hubspot__engagement_task 34. model.hubspot_source.stg_hubspot__engagement_task_tmp_33->73. model.hubspot_source.stg_hubspot__engagement_task_72 35. model.hubspot_source.stg_hubspot__engagement_tmp_34 35. model.hubspot_source.stg_hubspot__engagement_tmp 65. model.hubspot_source.stg_hubspot__engagement_64 65. model.hubspot_source.stg_hubspot__engagement 35. model.hubspot_source.stg_hubspot__engagement_tmp_34->65. model.hubspot_source.stg_hubspot__engagement_64 36. model.hubspot_source.stg_hubspot__owner_tmp_35 36. model.hubspot_source.stg_hubspot__owner_tmp 74. model.hubspot_source.stg_hubspot__owner_73 74. model.hubspot_source.stg_hubspot__owner 36. model.hubspot_source.stg_hubspot__owner_tmp_35->74. model.hubspot_source.stg_hubspot__owner_73 37. model.hubspot_source.stg_hubspot__property_option_tmp_36 37. model.hubspot_source.stg_hubspot__property_option_tmp 76. model.hubspot_source.stg_hubspot__property_option_75 76. model.hubspot_source.stg_hubspot__property_option 37. model.hubspot_source.stg_hubspot__property_option_tmp_36->76. model.hubspot_source.stg_hubspot__property_option_75 38. model.hubspot_source.stg_hubspot__property_tmp_37 38. model.hubspot_source.stg_hubspot__property_tmp 75. model.hubspot_source.stg_hubspot__property_74 75. model.hubspot_source.stg_hubspot__property 38. model.hubspot_source.stg_hubspot__property_tmp_37->75. model.hubspot_source.stg_hubspot__property_74 102. model.hubspot.hubspot__companies_101 102. model.hubspot.hubspot__companies 39. model.hubspot_source.stg_hubspot__company_38->102. model.hubspot.hubspot__companies_101 77. model.hubspot.hubspot__company_history_76 77. model.hubspot.hubspot__company_history 40. model.hubspot_source.stg_hubspot__company_property_history_39->77. model.hubspot.hubspot__company_history_76 80. model.hubspot.int_hubspot__contact_merge_adjust_79 80. model.hubspot.int_hubspot__contact_merge_adjust 41. model.hubspot_source.stg_hubspot__contact_40->80. model.hubspot.int_hubspot__contact_merge_adjust_79 109. model.hubspot.hubspot__contact_lists_108 109. model.hubspot.hubspot__contact_lists 42. model.hubspot_source.stg_hubspot__contact_list_41->109. model.hubspot.hubspot__contact_lists_108 107. model.hubspot.int_hubspot__email_metrics__by_contact_list_106 107. model.hubspot.int_hubspot__email_metrics__by_contact_list 43. model.hubspot_source.stg_hubspot__contact_list_member_42->107. model.hubspot.int_hubspot__email_metrics__by_contact_list_106 78. model.hubspot.hubspot__contact_history_77 78. model.hubspot.hubspot__contact_history 44. model.hubspot_source.stg_hubspot__contact_property_history_43->78. model.hubspot.hubspot__contact_history_77 94. model.hubspot.int_hubspot__deals_enhanced_93 94. model.hubspot.int_hubspot__deals_enhanced 45. model.hubspot_source.stg_hubspot__deal_44->94. model.hubspot.int_hubspot__deals_enhanced_93 48. model.hubspot_source.stg_hubspot__deal_pipeline_47->94. model.hubspot.int_hubspot__deals_enhanced_93 103. model.hubspot.hubspot__deal_stages_102 103. model.hubspot.hubspot__deal_stages 48. model.hubspot_source.stg_hubspot__deal_pipeline_47->103. model.hubspot.hubspot__deal_stages_102 49. model.hubspot_source.stg_hubspot__deal_pipeline_stage_48->94. model.hubspot.int_hubspot__deals_enhanced_93 49. model.hubspot_source.stg_hubspot__deal_pipeline_stage_48->103. model.hubspot.hubspot__deal_stages_102 79. model.hubspot.hubspot__deal_history_78 79. model.hubspot.hubspot__deal_history 50. model.hubspot_source.stg_hubspot__deal_property_history_49->79. model.hubspot.hubspot__deal_history_78 51. model.hubspot_source.stg_hubspot__deal_stage_50->103. model.hubspot.hubspot__deal_stages_102 106. model.hubspot.hubspot__email_campaigns_105 106. model.hubspot.hubspot__email_campaigns 52. model.hubspot_source.stg_hubspot__email_campaign_51->106. model.hubspot.hubspot__email_campaigns_105 81. model.hubspot.int_hubspot__email_event_aggregates_80 81. model.hubspot.int_hubspot__email_event_aggregates 53. model.hubspot_source.stg_hubspot__email_event_52->81. model.hubspot.int_hubspot__email_event_aggregates_80 82. model.hubspot.hubspot__email_event_bounce_81 82. model.hubspot.hubspot__email_event_bounce 53. model.hubspot_source.stg_hubspot__email_event_52->82. model.hubspot.hubspot__email_event_bounce_81 83. model.hubspot.hubspot__email_event_clicks_82 83. model.hubspot.hubspot__email_event_clicks 53. model.hubspot_source.stg_hubspot__email_event_52->83. model.hubspot.hubspot__email_event_clicks_82 84. model.hubspot.hubspot__email_event_deferred_83 84. model.hubspot.hubspot__email_event_deferred 53. model.hubspot_source.stg_hubspot__email_event_52->84. model.hubspot.hubspot__email_event_deferred_83 85. model.hubspot.hubspot__email_event_delivered_84 85. model.hubspot.hubspot__email_event_delivered 53. model.hubspot_source.stg_hubspot__email_event_52->85. model.hubspot.hubspot__email_event_delivered_84 86. model.hubspot.hubspot__email_event_dropped_85 86. model.hubspot.hubspot__email_event_dropped 53. model.hubspot_source.stg_hubspot__email_event_52->86. model.hubspot.hubspot__email_event_dropped_85 87. model.hubspot.hubspot__email_event_forward_86 87. model.hubspot.hubspot__email_event_forward 53. model.hubspot_source.stg_hubspot__email_event_52->87. model.hubspot.hubspot__email_event_forward_86 88. model.hubspot.hubspot__email_event_opens_87 88. model.hubspot.hubspot__email_event_opens 53. model.hubspot_source.stg_hubspot__email_event_52->88. model.hubspot.hubspot__email_event_opens_87 89. model.hubspot.hubspot__email_event_print_88 89. model.hubspot.hubspot__email_event_print 53. model.hubspot_source.stg_hubspot__email_event_52->89. model.hubspot.hubspot__email_event_print_88 90. model.hubspot.hubspot__email_event_sent_89 90. model.hubspot.hubspot__email_event_sent 53. model.hubspot_source.stg_hubspot__email_event_52->90. model.hubspot.hubspot__email_event_sent_89 91. model.hubspot.hubspot__email_event_spam_report_90 91. model.hubspot.hubspot__email_event_spam_report 53. model.hubspot_source.stg_hubspot__email_event_52->91. model.hubspot.hubspot__email_event_spam_report_90 92. model.hubspot.hubspot__email_event_status_change_91 92. model.hubspot.hubspot__email_event_status_change 53. model.hubspot_source.stg_hubspot__email_event_52->92. model.hubspot.hubspot__email_event_status_change_91 54. model.hubspot_source.stg_hubspot__email_event_bounce_53->82. model.hubspot.hubspot__email_event_bounce_81 55. model.hubspot_source.stg_hubspot__email_event_click_54->83. model.hubspot.hubspot__email_event_clicks_82 56. model.hubspot_source.stg_hubspot__email_event_deferred_55->84. model.hubspot.hubspot__email_event_deferred_83 57. model.hubspot_source.stg_hubspot__email_event_delivered_56->85. model.hubspot.hubspot__email_event_delivered_84 58. model.hubspot_source.stg_hubspot__email_event_dropped_57->86. model.hubspot.hubspot__email_event_dropped_85 59. model.hubspot_source.stg_hubspot__email_event_forward_58->87. model.hubspot.hubspot__email_event_forward_86 60. model.hubspot_source.stg_hubspot__email_event_open_59->88. model.hubspot.hubspot__email_event_opens_87 61. model.hubspot_source.stg_hubspot__email_event_print_60->89. model.hubspot.hubspot__email_event_print_88 62. model.hubspot_source.stg_hubspot__email_event_sent_61->90. model.hubspot.hubspot__email_event_sent_89 63. model.hubspot_source.stg_hubspot__email_event_spam_report_62->91. model.hubspot.hubspot__email_event_spam_report_90 64. model.hubspot_source.stg_hubspot__email_event_status_change_63->92. model.hubspot.hubspot__email_event_status_change_91 93. model.hubspot.hubspot__engagements_92 93. model.hubspot.hubspot__engagements 65. model.hubspot_source.stg_hubspot__engagement_64->93. model.hubspot.hubspot__engagements_92 96. model.hubspot.hubspot__engagement_calls_95 96. model.hubspot.hubspot__engagement_calls 66. model.hubspot_source.stg_hubspot__engagement_call_65->96. model.hubspot.hubspot__engagement_calls_95 67. model.hubspot_source.stg_hubspot__engagement_company_66->93. model.hubspot.hubspot__engagements_92 67. model.hubspot_source.stg_hubspot__engagement_company_66->102. model.hubspot.hubspot__companies_101 68. model.hubspot_source.stg_hubspot__engagement_contact_67->93. model.hubspot.hubspot__engagements_92 101. model.hubspot.int_hubspot__engagement_metrics__by_contact_100 101. model.hubspot.int_hubspot__engagement_metrics__by_contact 68. model.hubspot_source.stg_hubspot__engagement_contact_67->101. model.hubspot.int_hubspot__engagement_metrics__by_contact_100 69. model.hubspot_source.stg_hubspot__engagement_deal_68->93. model.hubspot.hubspot__engagements_92 104. model.hubspot.hubspot__deals_103 104. model.hubspot.hubspot__deals 69. model.hubspot_source.stg_hubspot__engagement_deal_68->104. model.hubspot.hubspot__deals_103 97. model.hubspot.hubspot__engagement_emails_96 97. model.hubspot.hubspot__engagement_emails 70. model.hubspot_source.stg_hubspot__engagement_email_69->97. model.hubspot.hubspot__engagement_emails_96 98. model.hubspot.hubspot__engagement_meetings_97 98. model.hubspot.hubspot__engagement_meetings 71. model.hubspot_source.stg_hubspot__engagement_meeting_70->98. model.hubspot.hubspot__engagement_meetings_97 99. model.hubspot.hubspot__engagement_notes_98 99. model.hubspot.hubspot__engagement_notes 72. model.hubspot_source.stg_hubspot__engagement_note_71->99. model.hubspot.hubspot__engagement_notes_98 100. model.hubspot.hubspot__engagement_tasks_99 100. model.hubspot.hubspot__engagement_tasks 73. model.hubspot_source.stg_hubspot__engagement_task_72->100. model.hubspot.hubspot__engagement_tasks_99 74. model.hubspot_source.stg_hubspot__owner_73->94. model.hubspot.int_hubspot__deals_enhanced_93 80. model.hubspot.int_hubspot__contact_merge_adjust_79->82. model.hubspot.hubspot__email_event_bounce_81 80. model.hubspot.int_hubspot__contact_merge_adjust_79->83. model.hubspot.hubspot__email_event_clicks_82 80. model.hubspot.int_hubspot__contact_merge_adjust_79->84. model.hubspot.hubspot__email_event_deferred_83 80. model.hubspot.int_hubspot__contact_merge_adjust_79->85. model.hubspot.hubspot__email_event_delivered_84 80. model.hubspot.int_hubspot__contact_merge_adjust_79->86. model.hubspot.hubspot__email_event_dropped_85 80. model.hubspot.int_hubspot__contact_merge_adjust_79->87. model.hubspot.hubspot__email_event_forward_86 80. model.hubspot.int_hubspot__contact_merge_adjust_79->88. model.hubspot.hubspot__email_event_opens_87 80. model.hubspot.int_hubspot__contact_merge_adjust_79->89. model.hubspot.hubspot__email_event_print_88 80. model.hubspot.int_hubspot__contact_merge_adjust_79->90. model.hubspot.hubspot__email_event_sent_89 80. model.hubspot.int_hubspot__contact_merge_adjust_79->91. model.hubspot.hubspot__email_event_spam_report_90 80. model.hubspot.int_hubspot__contact_merge_adjust_79->92. model.hubspot.hubspot__email_event_status_change_91 108. model.hubspot.hubspot__contacts_107 108. model.hubspot.hubspot__contacts 80. model.hubspot.int_hubspot__contact_merge_adjust_79->108. model.hubspot.hubspot__contacts_107 105. model.hubspot.hubspot__email_sends_104 105. model.hubspot.hubspot__email_sends 81. model.hubspot.int_hubspot__email_event_aggregates_80->105. model.hubspot.hubspot__email_sends_104 90. model.hubspot.hubspot__email_event_sent_89->105. model.hubspot.hubspot__email_sends_104 95. model.hubspot.int_hubspot__email_aggregate_status_change_94 95. model.hubspot.int_hubspot__email_aggregate_status_change 92. model.hubspot.hubspot__email_event_status_change_91->95. model.hubspot.int_hubspot__email_aggregate_status_change_94 93. model.hubspot.hubspot__engagements_92->96. model.hubspot.hubspot__engagement_calls_95 93. model.hubspot.hubspot__engagements_92->97. model.hubspot.hubspot__engagement_emails_96 93. model.hubspot.hubspot__engagements_92->98. model.hubspot.hubspot__engagement_meetings_97 93. model.hubspot.hubspot__engagements_92->99. model.hubspot.hubspot__engagement_notes_98 93. model.hubspot.hubspot__engagements_92->100. model.hubspot.hubspot__engagement_tasks_99 93. model.hubspot.hubspot__engagements_92->101. model.hubspot.int_hubspot__engagement_metrics__by_contact_100 93. model.hubspot.hubspot__engagements_92->102. model.hubspot.hubspot__companies_101 93. model.hubspot.hubspot__engagements_92->104. model.hubspot.hubspot__deals_103 94. model.hubspot.int_hubspot__deals_enhanced_93->103. model.hubspot.hubspot__deal_stages_102 94. model.hubspot.int_hubspot__deals_enhanced_93->104. model.hubspot.hubspot__deals_103 95. model.hubspot.int_hubspot__email_aggregate_status_change_94->105. model.hubspot.hubspot__email_sends_104 101. model.hubspot.int_hubspot__engagement_metrics__by_contact_100->108. model.hubspot.hubspot__contacts_107 105. model.hubspot.hubspot__email_sends_104->106. model.hubspot.hubspot__email_campaigns_105 105. model.hubspot.hubspot__email_sends_104->107. model.hubspot.int_hubspot__email_metrics__by_contact_list_106 105. model.hubspot.hubspot__email_sends_104->108. model.hubspot.hubspot__contacts_107 105. model.hubspot.hubspot__email_sends_104->109. model.hubspot.hubspot__contact_lists_108 107. model.hubspot.int_hubspot__email_metrics__by_contact_list_106->109. model.hubspot.hubspot__contact_lists_108
1. model.hubspot_source.stg_hubspot__company_property_history_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_company_enabled','hubspot_company_property_history_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','company_property_history')) }}
from {{ var('company_property_history') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
2. model.hubspot_source.stg_hubspot__company_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_company_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','company')) }}
from {{ var('company') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
3. model.hubspot_source.stg_hubspot__contact_list_member_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled', 'hubspot_contact_list_member_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','contact_list_member')) }}
from {{ var('contact_list_member') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
4. model.hubspot_source.stg_hubspot__contact_list_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled', 'hubspot_contact_list_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','contact_list')) }}
from {{ var('contact_list') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
5. model.hubspot_source.stg_hubspot__contact_property_history_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled', 'hubspot_contact_property_enabled', 'hubspot_contact_property_history_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','contact_property_history')) }}
from {{ var('contact_property_history') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
6. model.hubspot_source.stg_hubspot__contact_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled', 'hubspot_contact_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','contact')) }}
from {{ var('contact') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
7. model.hubspot_source.stg_hubspot__deal_company_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled','hubspot_deal_company_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','deal_company')) }}
from {{ var('deal_company') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
8. model.hubspot_source.stg_hubspot__deal_contact_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled','hubspot_deal_contact_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','deal_contact')) }}
from {{ var('deal_contact') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
9. model.hubspot_source.stg_hubspot__deal_pipeline_stage_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','deal_pipeline_stage')) }}
from {{ var('deal_pipeline_stage') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
10. model.hubspot_source.stg_hubspot__deal_pipeline_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','deal_pipeline')) }}
from {{ var('deal_pipeline') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
11. model.hubspot_source.stg_hubspot__deal_property_history_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled','hubspot_deal_property_history_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','deal_property_history')) }}
from {{ var('deal_property_history') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
12. model.hubspot_source.stg_hubspot__deal_stage_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','deal_stage')) }}
from {{ var('deal_stage') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
13. model.hubspot_source.stg_hubspot__deal_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','deal')) }}
from {{ var('deal') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
14. model.hubspot_source.stg_hubspot__email_campaign_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','email_campaign')) }}
from {{ var('email_campaign') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
15. model.hubspot_source.stg_hubspot__email_event_bounce_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_bounce_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','email_event_bounce')) }}
from {{ var('email_event_bounce') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
16. model.hubspot_source.stg_hubspot__email_event_click_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_click_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','email_event_click')) }}
from {{ var('email_event_click') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
17. model.hubspot_source.stg_hubspot__email_event_deferred_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_deferred_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','email_event_deferred')) }}
from {{ var('email_event_deferred') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
18. model.hubspot_source.stg_hubspot__email_event_delivered_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_delivered_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','email_event_delivered')) }}
from {{ var('email_event_delivered') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
19. model.hubspot_source.stg_hubspot__email_event_dropped_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_dropped_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','email_event_dropped')) }}
from {{ var('email_event_dropped') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
20. model.hubspot_source.stg_hubspot__email_event_forward_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_forward_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','email_event_forward')) }}
from {{ var('email_event_forward') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
21. model.hubspot_source.stg_hubspot__email_event_open_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_open_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','email_event_open')) }}
from {{ var('email_event_open') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
22. model.hubspot_source.stg_hubspot__email_event_print_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_print_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','email_event_print')) }}
from {{ var('email_event_print') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
23. model.hubspot_source.stg_hubspot__email_event_sent_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_sent_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','email_event_sent')) }}
from {{ var('email_event_sent') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
24. model.hubspot_source.stg_hubspot__email_event_spam_report_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_spam_report_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','email_event_spam_report')) }}
from {{ var('email_event_spam_report') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
25. model.hubspot_source.stg_hubspot__email_event_status_change_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_status_change_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','email_event_status_change')) }}
from {{ var('email_event_status_change') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
26. model.hubspot_source.stg_hubspot__email_event_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','email_event')) }}
from {{ var('email_event') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
27. model.hubspot_source.stg_hubspot__engagement_call_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_call_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','engagement_call')) }}
from {{ var('engagement_call') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
28. model.hubspot_source.stg_hubspot__engagement_company_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_company_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','engagement_company')) }}
from {{ var('engagement_company') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
29. model.hubspot_source.stg_hubspot__engagement_contact_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_contact_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','engagement_contact')) }}
from {{ var('engagement_contact') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
30. model.hubspot_source.stg_hubspot__engagement_deal_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_deal_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','engagement_deal')) }}
from {{ var('engagement_deal') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
31. model.hubspot_source.stg_hubspot__engagement_email_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_email_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','engagement_email')) }}
from {{ var('engagement_email') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
32. model.hubspot_source.stg_hubspot__engagement_meeting_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_meeting_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','engagement_meeting')) }}
from {{ var('engagement_meeting') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
33. model.hubspot_source.stg_hubspot__engagement_note_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_note_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','engagement_note')) }}
from {{ var('engagement_note') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
34. model.hubspot_source.stg_hubspot__engagement_task_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_task_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','engagement_task')) }}
from {{ var('engagement_task') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
35. model.hubspot_source.stg_hubspot__engagement_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','engagement')) }}
from {{ var('engagement') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
36. model.hubspot_source.stg_hubspot__owner_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_owner_enabled'])) }}

select {{ dbt_utils.star(source('hubspot','owner')) }}
from {{ var('owner') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
37. model.hubspot_source.stg_hubspot__property_option_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=var('hubspot_property_enabled', True)) }}

select {{ dbt_utils.star(source('hubspot','property_option')) }}
from {{ var('property_option') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
38. model.hubspot_source.stg_hubspot__property_tmp
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=var('hubspot_property_enabled', True)) }}

select {{ dbt_utils.star(source('hubspot','property')) }}
from {{ var('property') }}
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
39. model.hubspot_source.stg_hubspot__company
Model catalog prepared by Cocoon

Model Description
Each record represents a company in Hubspot.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_company_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__company_tmp') }}

), macro as (

    select
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__company_tmp')),
                staging_columns=get_company_columns()
            )
        }}
    from base

), fields as (

    select

{% if var('hubspot__pass_through_all_columns', false) %}
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__company_tmp')),
                staging_columns=get_company_columns()
            )
        }}
        {% if all_passthrough_column_check('stg_hubspot__company_tmp',get_company_columns()) > 0 %}
        -- just pass everything through if extra columns are present, but ensure required columns are present.
        ,{{ 
            fivetran_utils.remove_prefix_from_columns(
                columns=adapter.get_columns_in_relation(ref('stg_hubspot__company_tmp')), 
                prefix='property_', exclude=get_macro_columns(get_company_columns()))
        }}
        {% endif %}
    from base

{% else %}
        -- just default columns + explicitly configured passthrough columns
        -- a few columns below are aliased within the macros/get_company_columns.sql macro
        company_id,
        is_company_deleted,
        cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,
        company_name,
        description,
        created_date,
        industry,
        street_address,
        street_address_2,
        city,
        state,
        country,
        company_annual_revenue
        
        --The below macro adds the fields defined within your hubspot__ticket_pass_through_columns variable into the staging model
        {{ fivetran_utils.fill_pass_through_columns('hubspot__company_pass_through_columns') }}

        -- The below macro add the ability to create calculated fields using the hubspot__company_calculated_fields variable.
        {{ fivetran_utils.calculated_fields('hubspot__company_calculated_fields') }}
        
    from macro

{% endif %}

), joined as (
    {{ add_property_labels('hubspot__company_pass_through_columns', cte_name='fields') }}
)

select *
from joined
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
is_company_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
company_id The ID of the company.
company_name The name of the company.
description A short statement about the company's mission and goals.
created_date The date the company was added to your account.
industry The type of business the company performs.
street_address The street address of the company.
street_address_2 Additional address information for the company.
city The city where the company is located.
state The state where the company is located.
country The country where the company is located.
company_annual_revenue The actual or estimated annual revenue of the company.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
40. model.hubspot_source.stg_hubspot__company_property_history
Model catalog prepared by Cocoon

Model Description
Each record represents a change to company record in Hubspot.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_company_enabled','hubspot_company_property_history_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__company_property_history_tmp') }}

), macro as (

    select
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__company_property_history_tmp')),
                staging_columns=get_company_property_history_columns()
            )
        }}
    from base

), fields as (

    select
        cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,
        company_id,
        name as field_name,
        source as change_source,
        source_id as change_source_id,
        cast(change_timestamp as {{ dbt.type_timestamp() }}) as change_timestamp, -- source field name = timestamp ; alias declared in macros/get_company_property_history_columns.sql
        value as new_value
    from macro
    
)

select *
from fields
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
change_source The source (reason) of the change.
change_source_id The ID of the object that caused the change, if applicable.
change_timestamp The timestamp the changed occurred.
company_id The ID of the related company record.
field_name The name of the field being changed.
new_value The new value of the field.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
41. model.hubspot_source.stg_hubspot__contact
Model catalog prepared by Cocoon

Model Description
Each record represents a contact in Hubspot.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled', 'hubspot_contact_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__contact_tmp') }}

), macro as (

    select
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__contact_tmp')),
                staging_columns=get_contact_columns()
            )
        }}
    from base

), fields as (

    select

{% if var('hubspot__pass_through_all_columns', false) %}
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__contact_tmp')),
                staging_columns=get_contact_columns()
            )
        }}
        {% if all_passthrough_column_check('stg_hubspot__contact_tmp',get_contact_columns()) > 0 %}
        -- just pass everything through if extra columns are present, but ensure required columns are present.
        ,{{ 
            fivetran_utils.remove_prefix_from_columns(
                columns=adapter.get_columns_in_relation(ref('stg_hubspot__contact_tmp')), 
                prefix='property_', exclude=get_macro_columns(get_contact_columns())) 
        }}
        {% endif %}
    from base

{% else %}
        -- just default columns + explicitly configured passthrough columns.
        -- a few columns below are aliased within the macros/get_contact_columns.sql macro
        contact_id,
        is_contact_deleted,
        calculated_merged_vids, -- will be null for BigQuery users until v3 api is rolled out to them
        email,
        contact_company,
        first_name,
        last_name,
        cast(created_date as {{ dbt.type_timestamp() }}) as created_date,
        job_title,
        company_annual_revenue,
        cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced

        --The below macro adds the fields defined within your hubspot__contact_pass_through_columns variable into the staging model
        {{ fivetran_utils.fill_pass_through_columns('hubspot__contact_pass_through_columns') }}

        -- The below macro add the ability to create calculated fields using the hubspot__contact_calculated_fields variable.
        {{ fivetran_utils.calculated_fields('hubspot__contact_calculated_fields') }}

    from macro
{% endif %}    

), joined as (
    {{ add_property_labels('hubspot__contact_pass_through_columns', cte_name='fields') }}
)

select *
from joined
Column Description
column_name description
is_contact_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
_fivetran_synced Timestamp of when Fivetran synced a record.
contact_id The ID of the contact.
email The contact's email.
contact_company The name of the contact's company.
first_name The contact's first name.
last_name The contact's last name.
created_date The date that the contact was created in your HubSpot account.
job_title The contact's job title.
company_annual_revenue The contact's annual company revenue.
calculated_merged_vids List of mappings representing contact IDs that have been merged into the contact at hand. Format: <merged_contact_id>:<merged_at_in_epoch_time>;<second_merged_contact_id>:<merged_at_in_epoch_time> This field has replaced the `CONTACT_MERGE_AUDIT` table, which was deprecated by the Hubspot v3 CRM API.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
42. model.hubspot_source.stg_hubspot__contact_list
Model catalog prepared by Cocoon

Model Description
Each record represents a contact list in Hubspot.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled', 'hubspot_contact_list_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__contact_list_tmp') }}

), macro as (

    select
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__contact_list_tmp')),
                staging_columns=get_contact_list_columns()
            )
        }}
    from base

), fields as (

    select
        _fivetran_deleted as is_contact_list_deleted,
        cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,
        cast(created_at as {{ dbt.type_timestamp() }}) as created_timestamp,
        deleteable as is_deletable,
        dynamic as is_dynamic,
        id as contact_list_id,
        metadata_error,
        cast(metadata_last_processing_state_change_at as {{ dbt.type_timestamp() }}) as metadata_last_processing_state_change_at,
        cast(metadata_last_size_change_at as {{ dbt.type_timestamp() }}) as metadata_last_size_change_at,
        metadata_processing,
        metadata_size,
        name as contact_list_name,
        portal_id,
        cast(updated_at as {{ dbt.type_timestamp() }}) as updated_timestamp
    from macro
    
)

select *
from fields
Column Description
column_name description
is_contact_list_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
_fivetran_synced Timestamp of when Fivetran synced a record.
contact_list_id The ID of the contact list.
contact_list_name The name of the contact list.
created_timestamp A timestamp of the time the list was created.
is_deletable If this is false, this is a system list and cannot be deleted.
is_dynamic Whether the contact list is dynamic.
metadata_error Any errors that happened the last time the list was processed.
metadata_last_processing_state_change_at A timestamp of the last time that the processing state changed.
metadata_last_size_change_at A timestamp of the last time that the size of the list changed.
metadata_processing One of DONE, REFRESHING, INITIALIZING, or PROCESSING. \nDONE indicates the list has finished processing, any other value indicates that list membership is being evaluated.\n
metadata_size The approximate number of contacts in the list.
portal_id The hub ID.
updated_timestamp A timestamp of the time that the list was last modified.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
43. model.hubspot_source.stg_hubspot__contact_list_member
Model catalog prepared by Cocoon

Model Description
Each record represents a 'link' between a contact and a contact list.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled', 'hubspot_contact_list_member_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__contact_list_member_tmp') }} 

), macro as (

    select
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__contact_list_member_tmp')),
                staging_columns=get_contact_list_member_columns()
            )
        }}
    from base

), fields as (

    select
        _fivetran_deleted as is_contact_list_member_deleted,
        cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,
        cast(added_at as {{ dbt.type_timestamp() }}) as added_timestamp,
        contact_id,
        contact_list_id
    from macro
    
)

select *
from fields
Column Description
column_name description
is_contact_list_member_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
_fivetran_synced Timestamp of when Fivetran synced a record.
added_timestamp The timestamp a contact was added to a list.
contact_id The ID of the related contact.
contact_list_id The ID of the related contact list.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
44. model.hubspot_source.stg_hubspot__contact_property_history
Model catalog prepared by Cocoon

Model Description
Each record represents a change to contact record in Hubspot.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled', 'hubspot_contact_property_enabled', 'hubspot_contact_property_history_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__contact_property_history_tmp') }}

), macro as (

    select
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__contact_property_history_tmp')),
                staging_columns=get_contact_property_history_columns()
            )
        }}
    from base

), fields as (

    select
        cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,
        contact_id,
        name as field_name,
        source as change_source,
        source_id as change_source_id,
        cast(change_timestamp as {{ dbt.type_timestamp() }}) as change_timestamp, -- source field name = timestamp ; alias declared in macros/get_contact_property_history_columns.sql
        value as new_value
    from macro
    
)

select *
from fields
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
change_source The source (reason) of the change.
change_source_id The ID of the object that caused the change, if applicable.
change_timestamp The timestamp the changed occurred.
contact_id The ID of the related contact record.
field_name The name of the field being changed.
new_value The new value of the field.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
45. model.hubspot_source.stg_hubspot__deal
Model catalog prepared by Cocoon

Model Description
Each record represents a deal in Hubspot.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__deal_tmp') }}

), macro as (

    select
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__deal_tmp')),
                staging_columns=get_deal_columns()
            )
        }}
    from base

), fields as (

    select

{% if var('hubspot__pass_through_all_columns', false) %}
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__deal_tmp')),
                staging_columns=get_deal_columns()
            )
        }}
        {% if all_passthrough_column_check('stg_hubspot__deal_tmp',get_deal_columns()) > 0 %}
        -- just pass everything through if extra columns are present, but ensure required columns are present.
        ,{{ 
            fivetran_utils.remove_prefix_from_columns(
                columns=adapter.get_columns_in_relation(ref('stg_hubspot__deal_tmp')), 
                prefix='property_',exclude=get_macro_columns(get_deal_columns()))
        }}
        {% endif %}
    from base

{% else %}
        -- just default columns + explicitly configured passthrough columns
        -- a few columns below are aliased within the macros/get_deal_columns.sql macro
        deal_name,
        cast(closed_date as {{ dbt.type_timestamp() }}) as closed_date,
        cast(created_date as {{ dbt.type_timestamp() }}) as created_date,
        is_deal_deleted,
        cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,
        deal_id,
        cast(deal_pipeline_id as {{ dbt.type_string() }}) as deal_pipeline_id,
        cast(deal_pipeline_stage_id as {{ dbt.type_string() }}) as deal_pipeline_stage_id,
        owner_id,
        portal_id,
        description,
        amount

        --The below macro adds the fields defined within your hubspot__deal_pass_through_columns variable into the staging model
        {{ fivetran_utils.fill_pass_through_columns('hubspot__deal_pass_through_columns') }}

        -- The below macro add the ability to create calculated fields using the hubspot__deal_calculated_fields variable.
        {{ fivetran_utils.calculated_fields('hubspot__deal_calculated_fields') }}

    from macro
{% endif %}

), joined as (
    {{ add_property_labels('hubspot__deal_pass_through_columns', cte_name='fields') }}
)

select *
from joined
Column Description
column_name description
is_deal_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
_fivetran_synced Timestamp of when Fivetran synced a record.
deal_id The ID of the deal
portal_id The hub ID.
deal_pipeline_id The ID of the deal's pipeline.
deal_pipeline_stage_id The ID of the deal's pipeline stage.
owner_id The ID of the deal's owner.
deal_name The name you have given this deal.
description A brief description of the deal.
amount The total value of the deal in the deal's currency.
closed_date The day the deal is expected to close, or was closed.
created_date The date the deal was created. This property is set automatically by HubSpot.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
46. model.hubspot_source.stg_hubspot__deal_company
Model catalog prepared by Cocoon

Model Description
Each record represents a 'link' between a deal and company.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled','hubspot_deal_company_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__deal_company_tmp') }}

), macro as (

    select 
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__deal_company_tmp')),
                staging_columns=get_deal_company_columns()
            )
        }}
    from base

), fields as (

    select
        company_id,
        deal_id,
        type_id,
        cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced
        
    from macro
    
)

select *
from fields
Column Description
column_name description
company_id The ID of the company.
deal_id The ID of the deal.
type_id The ID of the type.
_fivetran_synced Timestamp of when Fivetran synced a record.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
47. model.hubspot_source.stg_hubspot__deal_contact
Model catalog prepared by Cocoon

Model Description
Each record represents a 'link' between a deal and contact.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled','hubspot_deal_contact_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__deal_contact_tmp') }}

), macro as (

    select 
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__deal_contact_tmp')),
                staging_columns=get_deal_contact_columns()
            )
        }}
    from base

), fields as (

    select
        contact_id,
        deal_id,
        type_id,
        cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced
        
    from macro
    
)

select *
from fields
Column Description
column_name description
contact_id The ID of the contact.
deal_id The ID of the deal.
type_id The ID of the type.
_fivetran_synced Timestamp of when Fivetran synced a record.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
48. model.hubspot_source.stg_hubspot__deal_pipeline
Model catalog prepared by Cocoon

Model Description
Each record represents a pipeline in Hubspot.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__deal_pipeline_tmp') }}

), macro as (

    select
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__deal_pipeline_tmp')),
                staging_columns=get_deal_pipeline_columns()
            )
        }}
    from base

), fields as (

    select
        _fivetran_deleted as is_deal_pipeline_deleted,
        cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,
        active as is_active,
        display_order,
        label as pipeline_label,
        cast(pipeline_id as {{ dbt.type_string() }}) as deal_pipeline_id,
        created_at as deal_pipeline_created_at,
        updated_at as deal_pipeline_updated_at
    from macro
    
)

select *
from fields
Column Description
column_name description
is_deal_pipeline_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
_fivetran_synced Timestamp of when Fivetran synced a record.
deal_pipeline_id The ID of the pipeline.
display_order Used to determine the order in which the pipelines appear when viewed in HubSpot
deal_pipeline_created_at A timestamp representing when the record was created.
deal_pipeline_updated_at A timestamp representing when the record was updated.
is_active Whether the stage is currently in use.
pipeline_label The human-readable label for the pipeline. The label is used when showing the pipeline in HubSpot.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
49. model.hubspot_source.stg_hubspot__deal_pipeline_stage
Model catalog prepared by Cocoon

Model Description
Each record represents a pipeline stage in Hubspot.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__deal_pipeline_stage_tmp') }}

), macro as (

    select 
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__deal_pipeline_stage_tmp')),
                staging_columns=get_deal_pipeline_stage_columns()
            )
        }}
    from base

), fields as (

    select
        _fivetran_deleted as is_deal_pipeline_stage_deleted,
        cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,
        active as is_active,
        closed_won as is_closed_won,
        display_order,
        label as pipeline_stage_label,
        pipeline_id as deal_pipeline_id,
        probability,
        cast(stage_id as {{ dbt.type_string() }}) as deal_pipeline_stage_id,
        created_at as deal_pipeline_stage_created_at,
        updated_at as deal_pipeline_stage_updated_at
    from macro
    
)

select *
from fields
Column Description
column_name description
is_deal_pipeline_stage_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
_fivetran_synced Timestamp of when Fivetran synced a record.
deal_pipeline_id The ID of the related pipeline.
deal_pipeline_stage_id The ID of the pipeline stage.
display_order Used to determine the order in which the stages appear when viewed in HubSpot.
is_active Whether the pipeline stage is currently in use.
is_closed_won Whether the stage represents a Closed Won deal.
pipeline_stage_label The human-readable label for the stage. The label is used when showing the stage in HubSpot.
probability The probability that the deal will close. Used for the deal forecast.
deal_pipeline_stage_created_at A timestamp representing when the record was created.
deal_pipeline_stage_updated_at A timestamp representing when the record was updated.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
50. model.hubspot_source.stg_hubspot__deal_property_history
Model catalog prepared by Cocoon

Model Description
Each record represents the details of your deal properties.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled','hubspot_deal_property_history_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__deal_property_history_tmp') }}

), macro as (

    select
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__deal_property_history_tmp')),
                staging_columns=get_deal_property_history_columns()
            )
        }}
    from base

), fields as (

    select
        cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,
        deal_id,
        name as field_name,
        source as change_source,
        source_id as change_source_id,
        cast(change_timestamp as {{ dbt.type_timestamp() }}) as change_timestamp, -- source field name = timestamp ; alias declared in macros/get_deal_property_history_columns.sql
        value as new_value
    from macro
    
)

select *
from fields
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
change_source The source (reason) of the change.
change_source_id The ID of the object that caused the change, if applicable.
change_timestamp The timestamp the changed occurred.
deal_id The ID of the related deal record.
field_name The name of the field being changed.
new_value The new value of the field.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
51. model.hubspot_source.stg_hubspot__deal_stage
Model catalog prepared by Cocoon

Model Description
Each record represents a deal stage.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled'])) }}

with base as (

    select * 
    from {{ ref('stg_hubspot__deal_stage_tmp') }}

),

fields as (

    select
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__deal_stage_tmp')),
                staging_columns=get_deal_stage_columns()
            )
        }}
        
    from base
),

final as (
    
    select 
        cast(date_entered as {{ dbt.type_timestamp() }}) as date_entered,
        deal_id,
        source,
        source_id,
        value as deal_stage_name,
        _fivetran_active,
        cast(_fivetran_end as {{ dbt.type_timestamp() }}) as _fivetran_end,
        cast(_fivetran_start as {{ dbt.type_timestamp() }}) as _fivetran_start
    from fields
)

select * 
from final
Column Description
column_name description
_fivetran_active Boolean indicating whether the deal stage is active.
_fivetran_end The Fivetran calculated exist time of the deal stage.
_fivetran_start The date the deal stage was entered.
_fivetran_synced Timestamp of when Fivetran synced a record.
date_entered The timestamp the deal stage was entered.
deal_id Reference to the deal.
source The relevant source of the deal stage.
source_id Reference to the source.
deal_stage_name The value of the deal stage. Typically the name of the stage.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
52. model.hubspot_source.stg_hubspot__email_campaign
Model catalog prepared by Cocoon

Model Description
Each record represents an email campaign in Hubspot.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__email_campaign_tmp') }}

), macro as (

    select
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__email_campaign_tmp')),
                staging_columns=get_email_campaign_columns()
            )
        }}
    from base

), fields as (

    select
        cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,
        app_id,
        app_name,
        content_id,
        id as email_campaign_id,
        name as email_campaign_name,
        num_included,
        num_queued,
        sub_type as email_campaign_sub_type,
        subject as email_campaign_subject,
        type as email_campaign_type
    from macro
    
)

select *
from fields
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
app_id The app ID.
app_name The app name.
content_id The ID of the content.
email_campaign_id The ID of the email campaign.
email_campaign_name The name of the email campaign.
email_campaign_sub_type The email campaign sub-type.
email_campaign_subject The subject of the email campaign.
email_campaign_type The email campaign type.
num_included The number of messages included as part of the email campaign.
num_queued The number of messages queued as part of the email campaign.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
53. model.hubspot_source.stg_hubspot__email_event
Model catalog prepared by Cocoon

Model Description
Each record represents an email event in Hubspot.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__email_event_tmp') }}

), macro as (

    select
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__email_event_tmp')),
                staging_columns=get_email_event_columns()
            )
        }}
    from base

), fields as (

    select
        cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,
        app_id,
        cast(caused_by_created as {{ dbt.type_timestamp() }}) as caused_timestamp,
        caused_by_id as caused_by_event_id,
        cast(created as {{ dbt.type_timestamp() }}) as created_timestamp,
        email_campaign_id,
        filtered_event as is_filtered_event,
        id as event_id,
        cast(obsoleted_by_created as {{ dbt.type_timestamp() }}) as obsoleted_timestamp,
        obsoleted_by_id as obsoleted_by_event_id,
        portal_id,
        recipient as recipient_email_address,
        cast(sent_by_created as {{ dbt.type_timestamp() }}) as sent_timestamp,
        sent_by_id as sent_by_event_id,
        type as event_type
    from macro
    
)

select *
from fields
{% if not var('hubspot_using_all_email_events',true) -%}
where not coalesce(is_filtered_event, false)
{%- endif -%}
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
app_id The ID of the app that sent the email.
caused_by_event_id The event ID which uniquely identifies the event which directly caused this event. If not applicable, this property is omitted.
caused_timestamp The timestamp of the event that caused this event.
created_timestamp The created timestamp of the event.
email_campaign_id The ID of the related email campaign.
event_id The ID of the event.
event_type The type of event.
is_filtered_event A boolean representing whether the event has been filtered out of reporting based on customer reports settings or not.
obsoleted_by_event_id The event ID which uniquely identifies the follow-on event which makes this current event obsolete. If not applicable, this property is omitted.
obsoleted_timestamp The timestamp of the event that made the current event obsolete.
portal_id The hub ID.
recipient_email_address The email address of the contact related to the event.
sent_by_event_id The event ID which uniquely identifies the email message's SENT event. If not applicable, this property is omitted.
sent_timestamp The timestamp of the SENT event related to this event.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
54. model.hubspot_source.stg_hubspot__email_event_bounce
Model catalog prepared by Cocoon

Model Description
Each record represents a BOUNCE email event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_bounce_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__email_event_bounce_tmp') }}

), macro as (

    select
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__email_event_bounce_tmp')),
                staging_columns=get_email_event_bounce_columns()
            )
        }}
    from base
    
), fields as (

    select
        cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,
        category as bounce_category,
        id as event_id,
        response as returned_response,
        status as returned_status
    from macro
    
)

select *
from fields
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
bounce_category The best-guess of the type of bounce encountered. \nIf an appropriate category couldn't be determined, this property is omitted. See below for the possible values. \nNote that this is a derived value, and may be modified at any time to improve the accuracy of classification.\n
event_id The ID of the event.
returned_response The full response from the recipient's email server.
returned_status The status code returned from the recipient's email server.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
55. model.hubspot_source.stg_hubspot__email_event_click
Model catalog prepared by Cocoon

Model Description
Each record represents a CLICK email event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_click_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__email_event_click_tmp') }}

), macro as (

    select
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__email_event_click_tmp')),
                staging_columns=get_email_event_click_columns()
            )
        }}
    from base

), fields as (

    select
        cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,
        browser,
        id as event_id,
        ip_address,
        location as geo_location,
        referer as referer_url,
        url as click_url,
        user_agent
    from macro
    
)

select *
from fields
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
browser A JSON object representing the browser which serviced the event. Its comprised of the properties: 'name', 'family', 'producer', 'producer_url', 'type', 'url', 'version'.
click_url The URL within the message that the recipient clicked.
event_id The ID of the event.
geo_location A JSON object representing the location where the event occurred. It's comprised of the properties: 'city', 'state', 'country'.
ip_address The contact's IP address when the event occurred.
referer_url The URL of the webpage that linked to the URL clicked. Whether this is provided, and what its value is, is determined by the recipient's email client.
user_agent The user agent responsible for the event, e.g. “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36”
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
56. model.hubspot_source.stg_hubspot__email_event_deferred
Model catalog prepared by Cocoon

Model Description
Each record represents a DEFERRED email event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_deferred_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__email_event_deferred_tmp') }}

), macro as (

    select
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__email_event_deferred_tmp')),
                staging_columns=get_email_event_deferred_columns()
            )
        }}
    from base

), fields as (

    select
        cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,
        attempt as attempt_number,
        id as event_id,
        response as returned_response
    from macro
    
)

select *
from fields
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
attempt_number The delivery attempt number.
event_id The ID of the event.
returned_response The full response from the recipient's email server.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
57. model.hubspot_source.stg_hubspot__email_event_delivered
Model catalog prepared by Cocoon

Model Description
Each record represents a DELIVERED email event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_delivered_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__email_event_delivered_tmp') }}

), macro as (

    select
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__email_event_delivered_tmp')),
                staging_columns=get_email_event_delivered_columns()
            )
        }}
    from base

), fields as (

    select
        cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,
        id as event_id,
        response as returned_response,
        smtp_id
    from macro
    
)

select *
from fields
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
event_id The ID of the event.
returned_response The full response from the recipient's email server.
smtp_id An ID attached to the message by HubSpot.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
58. model.hubspot_source.stg_hubspot__email_event_dropped
Model catalog prepared by Cocoon

Model Description
Each record represents a DROPPED email event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_dropped_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__email_event_dropped_tmp') }}

), macro as (

    select
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__email_event_dropped_tmp')),
                staging_columns=get_email_event_dropped_columns()
            )
        }}
    from base

), fields as (

    select
        cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,
        bcc as bcc_emails,
        cc as cc_emails,
        drop_message,
        drop_reason,
        from_email, -- source field name = from ; alias declared in macros/get_email_event_dropped_columns.sql
        id as event_id,
        reply_to as reply_to_email,
        subject as email_subject
    from macro
    
)

select *
from fields
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
bcc_emails The 'bcc' field of the email message.
cc_emails The 'cc' field of the email message.
drop_message The raw message describing why the email message was dropped. This will usually provide additional details beyond 'dropReason'.
drop_reason The reason why the email message was dropped. See below for the possible values.
email_subject The subject line of the email message.
event_id The ID of the event.
from_email The 'from' field of the email message.
reply_to_email The 'reply-to' field of the email message.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
59. model.hubspot_source.stg_hubspot__email_event_forward
Model catalog prepared by Cocoon

Model Description
Each record represents a FORWARD email event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_forward_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__email_event_forward_tmp') }}

), macro as (

    select
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__email_event_forward_tmp')),
                staging_columns=get_email_event_forward_columns()
            )
        }}
    from base

), fields as (

    select
        cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,
        browser,
        id as event_id,
        ip_address,
        location as geo_location,
        user_agent
    from macro
    
)

select *
from fields
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
browser A JSON object representing the browser which serviced the event. Its comprised of the properties: 'name', 'family', 'producer', 'producer_url', 'type', 'url', 'version'.
event_id The ID of the event.
geo_location A JSON object representing the location where the event occurred. It's comprised of the properties: 'city', 'state', 'country'.
ip_address The contact's IP address when the event occurred.
user_agent The user agent responsible for the event, e.g. “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36”
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
60. model.hubspot_source.stg_hubspot__email_event_open
Model catalog prepared by Cocoon

Model Description
Each record represents a OPEN email event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_open_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__email_event_open_tmp') }}

), macro as (

    select
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__email_event_open_tmp')),
                staging_columns=get_email_event_open_columns()
            )
        }}
    from base

), fields as (

    select
        cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,
        browser,
        duration as duration_open,
        id as event_id,
        ip_address,
        location as geo_location,
        user_agent
    from macro
    
)

select *
from fields
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
browser A JSON object representing the browser which serviced the event. Its comprised of the properties: 'name', 'family', 'producer', 'producer_url', 'type', 'url', 'version'.
duration_open If provided and nonzero, the approximate number of milliseconds the user had opened the email.
event_id The ID of the event.
geo_location A JSON object representing the location where the event occurred. It's comprised of the properties: 'city', 'state', 'country'.
ip_address The contact's IP address when the event occurred.
user_agent The user agent responsible for the event, e.g. “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36”
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
61. model.hubspot_source.stg_hubspot__email_event_print
Model catalog prepared by Cocoon

Model Description
Each record represents a PRINT email event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_print_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__email_event_print_tmp') }}

), macro as (

    select
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__email_event_print_tmp')),
                staging_columns=get_email_event_print_columns()
            )
        }}
    from base

), fields as (

    select
        cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,
        browser,
        id as event_id,
        ip_address,
        location as geo_location,
        user_agent
    from macro
    
)

select *
from fields
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
browser A JSON object representing the browser which serviced the event. Its comprised of the properties: 'name', 'family', 'producer', 'producer_url', 'type', 'url', 'version'.
event_id The ID of the event.
geo_location A JSON object representing the location where the event occurred. It's comprised of the properties: 'city', 'state', 'country'.
ip_address The contact's IP address when the event occurred.
user_agent The user agent responsible for the event, e.g. “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36”
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
62. model.hubspot_source.stg_hubspot__email_event_sent
Model catalog prepared by Cocoon

Model Description
Each record represents a SENT email event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_sent_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__email_event_sent_tmp') }}

), macro as (

    select
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__email_event_sent_tmp')),
                staging_columns=get_email_event_sent_columns()
            )
        }}
    from base

), fields as (

    select
        cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,
        bcc as bcc_emails,
        cc as cc_emails,
        from_email, -- source field name = from ; alias declared in macros/get_email_event_sent_columns.sql
        id as event_id,
        reply_to as reply_to_email,
        subject as email_subject
    from macro
    
)

select *
from fields
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
bcc_emails The 'cc' field of the email message.
cc_emails The 'bcc' field of the email message.
email_subject The subject line of the email message.
event_id The ID of the event.
from_email The 'from' field of the email message.
reply_to_email The 'reply-to' field of the email message.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
63. model.hubspot_source.stg_hubspot__email_event_spam_report
Model catalog prepared by Cocoon

Model Description
Each record represents a SPAM_REPORT email event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_spam_report_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__email_event_spam_report_tmp') }}

), macro as (

    select
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__email_event_spam_report_tmp')),
                staging_columns=get_email_event_spam_report_columns()
            )
        }}
    from base

), fields as (

    select
        cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,
        id as event_id,
        ip_address,
        user_agent
    from macro
    
)

select *
from fields
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
event_id The ID of the event.
ip_address The contact's IP address when the event occurred.
user_agent The user agent responsible for the event, e.g. “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36”
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
64. model.hubspot_source.stg_hubspot__email_event_status_change
Model catalog prepared by Cocoon

Model Description
Each record represents a STATUS_CHANGE email event in Hubspot.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_status_change_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__email_event_status_change_tmp') }}

), macro as (

    select
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__email_event_status_change_tmp')),
                staging_columns=get_email_event_status_change_columns()
            )
        }}
    from base

), fields as (

    select
        cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,
        bounced as is_bounced,
        id as event_id,
        portal_subscription_status as subscription_status,
        requested_by as requested_by_email,
        source as change_source,
        subscriptions
    from macro
    
)

select *
from fields
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
change_source The source of the subscription change.
event_id The ID of the event.
is_bounced A HubSpot employee explicitly initiated the status change to block messages to the recipient. \n(Note this usage has been deprecated in favor of dropping messages with a 'dropReason' of BLOCKED_ADDRESS.)\n
requested_by_email The email address of the person requesting the change on behalf of the recipient. If not applicable, this property is omitted.
subscription_status The recipient's portal subscription status. \nNote that if this is 'UNSUBSCRIBED', the property 'subscriptions' is not necessarily an empty array, nor are all \nsubscriptions contained in it necessarily going to have their statuses set to 'UNSUBSCRIBED'.)\n
subscriptions An array of JSON objects representing the status of subscriptions for the recipient. \nEach JSON subscription object is comprised of the properties: 'id', 'status'.\n
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
65. model.hubspot_source.stg_hubspot__engagement
Model catalog prepared by Cocoon

Model Description
Each record represents an engagement
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__engagement_tmp') }}

), macro as (

    select
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__engagement_tmp')),
                staging_columns=get_engagement_columns()
            )
        }}
    from base

), fields as (

    select
        cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,
        id as engagement_id,
        created_timestamp,
        owner_id,
        occurred_timestamp,
        portal_id,
        engagement_type,
        is_active
    from macro
    
)

select *
from fields
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
engagement_id The ID of the engagement.
engagement_type One of NOTE, EMAIL, TASK, MEETING, or CALL, the type of the engagement.
is_active Whether the engagement is currently being shown in the UI.\nPLEASE NOTE - This field will only be populated for pre HubSpot v3 API versions. This field is only included to allow for backwards compatibility between HubSpot API versions. This field will be deprecated in the near future.\n
occurred_timestamp A timestamp in representing the time that the engagement should appear in the timeline.\nPLEASE NOTE - This field will only be populated for pre HubSpot v3 API versions. This field is only included to allow for backwards compatibility between HubSpot API versions. This field will be deprecated in the near future.\n
created_timestamp This field marks the call's time of creation and determines where the call sits on the record timeline. You can use either a Unix timestamp in milliseconds or UTC format. \nPLEASE NOTE: This field will only be populated for pre HubSpot v3 API versions. This field is only included to allow for backwards compatibility between HubSpot API versions. This field will be deprecated in the near future.\n
owner_id The ID of the engagement's owner.\nPLEASE NOTE - This field will only be populated for pre HubSpot v3 API versions. This field is only included to allow for backwards compatibility between HubSpot API versions. This field will be deprecated in the near future.\n
portal_id The hub ID.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
66. model.hubspot_source.stg_hubspot__engagement_call
Model catalog prepared by Cocoon

Model Description
Each record represents a CALL engagement event. All source `property_hs_*` fields
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_call_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__engagement_call_tmp') }}

), macro as (

    select
        {% set default_cols = adapter.get_columns_in_relation(ref('stg_hubspot__engagement_call_tmp')) %}
        {% set new_cols = remove_duplicate_and_prefix_from_columns(columns=default_cols, 
            prefix='property_hs_',exclude=get_macro_columns(get_engagement_call_columns())) %}
        {{
            fivetran_utils.fill_staging_columns(source_columns=default_cols,
                staging_columns=get_engagement_call_columns()
            )
        }}
        {% if new_cols | length > 0 %} 
            {{ new_cols }} 
        {% endif %}
    from base

)

select *
from macro
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
engagement_id The ID of the engagement.
_fivetran_deleted Boolean to mark rows that were deleted in the source database.
engagement_type The type of the engagement.
created_timestamp This field marks the call's time of creation and determines where the call sits on the record timeline. You can use either a Unix timestamp in milliseconds or UTC format. \nPLEASE NOTE: This field will only be populated for connectors utilizing the HubSpot v3 API version. For the pre HubSpot v3 versions, this value may be found within the parent `engagement` table.\n
occurred_timestamp This field marks the call's time of occurrence and determines where the call sits on the record timeline. You can use either a Unix timestamp in milliseconds or UTC format. \nPLEASE NOTE: This field will only be populated for connectors utilizing the HubSpot v3 API version. For the pre HubSpot v3 versions, this value may be found within the parent `engagement` table.\n
owner_id The ID of the owner associated with the call. This field determines the user listed as the call creator on the record timeline.\nPLEASE NOTE: This field will only be populated for connectors utilizing the HubSpot v3 API version. For the pre HubSpot v3 versions, this value may be found within the parent `engagement` table.\n
team_id The ID of the team associated with the call. This field determines the team listed as the call creator on the record timeline.\nPLEASE NOTE: This field will only be populated for connectors utilizing the HubSpot v3 API version.\n
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
67. model.hubspot_source.stg_hubspot__engagement_company
Model catalog prepared by Cocoon

Model Description
Each record represents a 'link' between a company and an engagement.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_company_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__engagement_company_tmp') }}

), macro as (

    select 
        {% set default_cols = adapter.get_columns_in_relation(ref('stg_hubspot__engagement_company_tmp')) %}
        {% set new_cols = remove_duplicate_and_prefix_from_columns(columns=default_cols, 
            prefix='property_hs_',exclude=get_macro_columns(get_engagement_company_columns())) %}
        {{
            fivetran_utils.fill_staging_columns(source_columns=default_cols,
                staging_columns=get_engagement_company_columns()
            )
        }}
        {% if new_cols | length > 0 %} 
            {{ new_cols }} 
        {% endif %}
    from base
)

select *
from macro
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
company_id The ID of the related company.
engagement_id The ID of the related engagement.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
68. model.hubspot_source.stg_hubspot__engagement_contact
Model catalog prepared by Cocoon

Model Description
Each record represents a 'link' between a contact and an engagement.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_contact_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__engagement_contact_tmp') }}

), macro as (

    select
        {% set default_cols = adapter.get_columns_in_relation(ref('stg_hubspot__engagement_contact_tmp')) %}
        {% set new_cols = remove_duplicate_and_prefix_from_columns(columns=default_cols, 
            prefix='property_hs_',exclude=get_macro_columns(get_engagement_contact_columns())) %}
        {{
            fivetran_utils.fill_staging_columns(source_columns=default_cols,
                staging_columns=get_engagement_contact_columns()
            )
        }}
        {% if new_cols | length > 0 %} 
            {{ new_cols }} 
        {% endif %}
    from base

)

select *
from macro
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
contact_id The ID of the related contact.
engagement_id The ID of the related engagement.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
69. model.hubspot_source.stg_hubspot__engagement_deal
Model catalog prepared by Cocoon

Model Description
Each record represents a 'link' between a deal and an engagement.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_deal_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__engagement_deal_tmp') }}

), macro as (

    select
        {% set default_cols = adapter.get_columns_in_relation(ref('stg_hubspot__engagement_deal_tmp')) %}
        {% set new_cols = remove_duplicate_and_prefix_from_columns(columns=default_cols, 
            prefix='property_hs_',exclude=get_macro_columns(get_engagement_deal_columns())) %}
        {{
            fivetran_utils.fill_staging_columns(source_columns=default_cols,
                staging_columns=get_engagement_deal_columns()
            )
        }}
        {% if new_cols | length > 0 %} 
            {{ new_cols }} 
        {% endif %}
    from base

)

select *
from macro
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
deal_id The ID of the related contact.
engagement_id The ID of the related engagement.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
70. model.hubspot_source.stg_hubspot__engagement_email
Model catalog prepared by Cocoon

Model Description
Each record represents an EMAIL engagement event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_email_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__engagement_email_tmp') }}

), macro as (

    select
        {% set default_cols = adapter.get_columns_in_relation(ref('stg_hubspot__engagement_email_tmp')) %}
        {% set new_cols = remove_duplicate_and_prefix_from_columns(columns=default_cols, 
            prefix='property_hs_',exclude=get_macro_columns(get_engagement_email_columns())) %}
        {{
            fivetran_utils.fill_staging_columns(source_columns=default_cols,
                staging_columns=get_engagement_email_columns()
            )
        }}
        {% if new_cols | length > 0 %} 
            {{ new_cols }} 
        {% endif %}
    from base

)

select *
from macro
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
_fivetran_deleted Boolean to mark rows that were deleted in the source database.
engagement_id The ID of the engagement.
engagement_type The type of the engagement.
created_timestamp This field marks the email's time of creation and determines where the email sits on the record timeline. You can use either a Unix timestamp in milliseconds or UTC format. \nPLEASE NOTE: This field will only be populated for connectors utilizing the HubSpot v3 API version. For the pre HubSpot v3 versions, this value may be found within the parent `engagement` table.\n
occurred_timestamp This field marks the email's time of occurrence and determines where the email sits on the record timeline. You can use either a Unix timestamp in milliseconds or UTC format. \nPLEASE NOTE: This field will only be populated for connectors utilizing the HubSpot v3 API version. For the pre HubSpot v3 versions, this value may be found within the parent `engagement` table.\n
owner_id The ID of the owner associated with the email. This field determines the user listed as the email creator on the record timeline.\nPLEASE NOTE: This field will only be populated for connectors utilizing the HubSpot v3 API version. For the pre HubSpot v3 versions, this value may be found within the parent `engagement` table.\n
team_id The ID of the team associated with the email. This field determines the team listed as the email creator on the record timeline.\nPLEASE NOTE: This field will only be populated for connectors utilizing the HubSpot v3 API version.\n
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
71. model.hubspot_source.stg_hubspot__engagement_meeting
Model catalog prepared by Cocoon

Model Description
Each record represents a MEETING engagement event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_meeting_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__engagement_meeting_tmp') }}

), macro as (

    select
        {% set default_cols = adapter.get_columns_in_relation(ref('stg_hubspot__engagement_meeting_tmp')) %}
        {% set new_cols = remove_duplicate_and_prefix_from_columns(columns=default_cols, 
            prefix='property_hs_',exclude=get_macro_columns(get_engagement_meeting_columns())) %}
        {{
            fivetran_utils.fill_staging_columns(source_columns=default_cols,
                staging_columns=get_engagement_meeting_columns()
            )
        }}
        {% if new_cols | length > 0 %} 
            {{ new_cols }} 
        {% endif %}
    from base

)

select *
from macro
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
_fivetran_deleted Boolean to mark rows that were deleted in the source database.
engagement_id The ID of the engagement.
engagement_type The type of the engagement.
created_timestamp This field marks the meeting's time of creation and determines where the meeting sits on the record timeline. You can use either a Unix timestamp in milliseconds or UTC format. \nPLEASE NOTE: This field will only be populated for connectors utilizing the HubSpot v3 API version. For the pre HubSpot v3 versions, this value may be found within the parent `engagement` table.\n
occurred_timestamp This field marks the meeting's time of occurrence and determines where the meeting sits on the record timeline. You can use either a Unix timestamp in milliseconds or UTC format. \nPLEASE NOTE: This field will only be populated for connectors utilizing the HubSpot v3 API version. For the pre HubSpot v3 versions, this value may be found within the parent `engagement` table.\n
owner_id The ID of the owner associated with the meeting. This field determines the user listed as the meeting creator on the record timeline.\nPLEASE NOTE: This field will only be populated for connectors utilizing the HubSpot v3 API version. For the pre HubSpot v3 versions, this value may be found within the parent `engagement` table.\n
team_id The ID of the team associated with the meeting. This field determines the team listed as the meeting creator on the record timeline.\nPLEASE NOTE: This field will only be populated for connectors utilizing the HubSpot v3 API version.\n
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
72. model.hubspot_source.stg_hubspot__engagement_note
Model catalog prepared by Cocoon

Model Description
Each record represents a NOTE engagement event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_note_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__engagement_note_tmp') }}

), macro as (

    select
        {% set default_cols = adapter.get_columns_in_relation(ref('stg_hubspot__engagement_note_tmp')) %}
        {% set new_cols = remove_duplicate_and_prefix_from_columns(columns=default_cols, 
            prefix='property_hs_',exclude=get_macro_columns(get_engagement_note_columns())) %}
        {{
            fivetran_utils.fill_staging_columns(source_columns=default_cols,
                staging_columns=get_engagement_note_columns()
            )
        }}
        {% if new_cols | length > 0 %} 
            {{ new_cols }} 
        {% endif %}
    from base

)

select *
from macro
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
_fivetran_deleted Boolean to mark rows that were deleted in the source database.
engagement_id The ID of the engagement.
engagement_type The type of the engagement.
note The body of the note. The body has a limit of 65536 characters.
created_timestamp This field marks the note's time of creation and determines where the note sits on the record timeline. You can use either a Unix timestamp in milliseconds or UTC format. \nPLEASE NOTE: This field will only be populated for connectors utilizing the HubSpot v3 API version. For the pre HubSpot v3 versions, this value may be found within the parent `engagement` table.\n
occurred_timestamp This field marks the note's time of occurrence and determines where the note sits on the record timeline. You can use either a Unix timestamp in milliseconds or UTC format. \nPLEASE NOTE: This field will only be populated for connectors utilizing the HubSpot v3 API version. For the pre HubSpot v3 versions, this value may be found within the parent `engagement` table.\n
owner_id The ID of the owner associated with the note. This field determines the user listed as the note creator on the record timeline.\nPLEASE NOTE: This field will only be populated for connectors utilizing the HubSpot v3 API version. For the pre HubSpot v3 versions, this value may be found within the parent `engagement` table.\n
team_id The ID of the team associated with the note. This field determines the team listed as the note creator on the record timeline.\nPLEASE NOTE: This field will only be populated for connectors utilizing the HubSpot v3 API version.\n
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
73. model.hubspot_source.stg_hubspot__engagement_task
Model catalog prepared by Cocoon

Model Description
Each record represents a TASK engagement event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_task_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__engagement_task_tmp') }}

), macro as (

    select
        {% set default_cols = adapter.get_columns_in_relation(ref('stg_hubspot__engagement_task_tmp')) %}
        {% set new_cols = remove_duplicate_and_prefix_from_columns(columns=default_cols, 
            prefix='property_hs_',exclude=get_macro_columns(get_engagement_task_columns())) %}
        {{
            fivetran_utils.fill_staging_columns(source_columns=default_cols,
                staging_columns=get_engagement_task_columns()
            )
        }}
        {% if new_cols | length > 0 %} 
            {{ new_cols }} 
        {% endif %}
    from base
)

select *
from macro
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
_fivetran_deleted Boolean to mark rows that were deleted in the source database.
engagement_id The ID of the engagement.
engagement_type The type of the engagement.
created_timestamp This field marks the task's time of creation and determines where the task sits on the record timeline. You can use either a Unix timestamp in milliseconds or UTC format. \nPLEASE NOTE: This field will only be populated for connectors utilizing the HubSpot v3 API version. For the pre HubSpot v3 versions, this value may be found within the parent `engagement` table.\n
occurred_timestamp This field marks the task's time of occurrence and determines where the task sits on the record timeline. You can use either a Unix timestamp in milliseconds or UTC format. \nPLEASE NOTE: This field will only be populated for connectors utilizing the HubSpot v3 API version. For the pre HubSpot v3 versions, this value may be found within the parent `engagement` table.\n
owner_id The ID of the owner associated with the task. This field determines the user listed as the task creator on the record timeline.\nPLEASE NOTE: This field will only be populated for connectors utilizing the HubSpot v3 API version. For the pre HubSpot v3 versions, this value may be found within the parent `engagement` table.\n
team_id The ID of the team associated with the task. This field determines the team listed as the task creator on the record timeline.\nPLEASE NOTE: This field will only be populated for connectors utilizing the HubSpot v3 API version.\n
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
74. model.hubspot_source.stg_hubspot__owner
Model catalog prepared by Cocoon

Model Description
Each record represents an owner/user in Hubspot.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_owner_enabled'])) }}

with base as (

    select *
    from {{ ref('stg_hubspot__owner_tmp') }}

), macro as (

    select
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__owner_tmp')),
                staging_columns=get_owner_columns()
            )
        }}
    from base

), fields as (

    select
        cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,
        cast(created_at as {{ dbt.type_timestamp() }}) as created_timestamp,
        email as email_address,
        first_name,
        last_name,
        owner_id,
        portal_id,
        type as owner_type,
        cast(updated_at as {{ dbt.type_timestamp() }}) as updated_timestamp,
        trim( {{ dbt.concat(['first_name', "' '", 'last_name']) }} ) as full_name
    from macro
    
)

select *
from fields
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
created_timestamp A timestamp for when the owner was created.
email_address The email address of the owner.
first_name The first name of the owner.
full_name Full name of the owner.
last_name The last name of the owner.
owner_id The ID of the owner.
portal_id The hub ID.
owner_type The type of owner.
updated_timestamp A timestamp for when the owner was last updated.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
75. model.hubspot_source.stg_hubspot__property
Model catalog prepared by Cocoon

Model Description
Each record represents a property.
SQL
{{ config(enabled=var('hubspot_property_enabled', True)) }}

with base as (

    select *
    from {{ ref('stg_hubspot__property_tmp') }}

), macro as (

    select
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__property_tmp')),
                staging_columns=get_property_columns()
            )
        }}
    from base

), fields as (

    select
        _fivetran_id,
        _fivetran_synced,
        calculated,
        created_at,
        description,
        field_type,
        group_name,
        hubspot_defined,
        hubspot_object,
        label as property_label,
        name as property_name,
        type as property_type,
        updated_at
    from macro
    
)

select *
from fields
Column Description
column_name description
_fivetran_id Fivetran generated id. Joins to `property_id` in the `property_option` table.
_fivetran_synced Timestamp of when Fivetran synced a record.
calculated Indicates if the property is calculated by a HubSpot process
created_at Timestamp representing when the property was created.
description A description of the property.
field_type One of textarea, text, date, file, number, select, radio, checkbox, or booleancheckbox.
group_name The name of the property group that the property belongs to.
hubspot_defined This will be true for default properties that are built into HubSpot.
hubspot_object If this property is related to other objects, the object will be listed here.
property_label A human readable label for the property.
property_name The internal name of the property.
property_type One of string, number, date, datetime, or enumeration.
updated_at Timestamp representing when the property was last updated.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
76. model.hubspot_source.stg_hubspot__property_option
Model catalog prepared by Cocoon

Model Description
Each record represents an option for the related property.
SQL
{{ config(enabled=var('hubspot_property_enabled', True)) }}

with base as (

    select *
    from {{ ref('stg_hubspot__property_option_tmp') }}

), macro as (

    select
        {{
            fivetran_utils.fill_staging_columns(
                source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__property_option_tmp')),
                staging_columns=get_property_option_columns()
            )
        }}
    from base

), fields as (

    select
        label as property_option_label,	
        property_id,
        _fivetran_synced,
        display_order,
        hidden,
        value as property_option_value
    from macro
    
)

select *
from fields
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
property_option_label The label of the option displayed inside the HubSpot app.
property_id The ID of the related property.
display_order Order of options displayed in Hubspot, starting with the lowest positive integer value. Values of -1 will cause the option to be displayed after any positive values.
hidden Boolean if the option will be displayed in HubSpot
property_option_value The internal value of the option.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
77. model.hubspot.hubspot__company_history
Model catalog prepared by Cocoon

Model Description
Each record represents a change to company record in Hubspot; the grain of this model is company_id -> field_name -> valid_to.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_company_enabled','hubspot_company_property_history_enabled'])) }}

with history as (

    select *
    from {{ var('company_property_history') }}

), windows as (

    select
        company_id,
        field_name,
        change_source,
        change_source_id,
        change_timestamp as valid_from,
        new_value,
        lead(change_timestamp) over (partition by company_id, field_name order by change_timestamp) as valid_to
    from history

), surrogate as (

    select 
        windows.*,
        {{ dbt_utils.generate_surrogate_key(['field_name','company_id','valid_from']) }} as id
    from windows

)

select *
from surrogate
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
change_source The source (reason) of the change.
change_source_id The ID of the object that caused the change, if applicable.
valid_from The timestamp the change was valid from.
valid_to The timestamp the change was valid to. Null if still valid.
company_id The ID of the related company record.
field_name The name of the field being changed.
new_value The new value of the field.
id The ID of the change.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
78. model.hubspot.hubspot__contact_history
Model catalog prepared by Cocoon

Model Description
Each record represents a change to contact record in Hubspot; the grain of this model is contact_id -> field_name -> valid_to.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled', 'hubspot_contact_property_enabled','hubspot_contact_property_history_enabled'])) }}

with history as (

    select *
    from {{ var('contact_property_history') }}

), windows as (

    select
        contact_id,
        field_name,
        change_source,
        change_source_id,
        change_timestamp as valid_from,
        new_value,
        lead(change_timestamp) over (partition by contact_id, field_name order by change_timestamp) as valid_to
    from history

), surrogate as (

    select 
        windows.*,
        {{ dbt_utils.generate_surrogate_key(['field_name','contact_id','valid_from']) }} as id
    from windows

)

select *
from surrogate
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
change_source The source (reason) of the change.
change_source_id The ID of the object that caused the change, if applicable.
valid_from The timestamp the change was valid from.
valid_to The timestamp the change was valid to. Null if still valid.
contact_id The ID of the related contact record.
field_name The name of the field being changed.
new_value The new value of the field.
id The ID of the change.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
79. model.hubspot.hubspot__deal_history
Model catalog prepared by Cocoon

Model Description
Each record represents a change to deal record in Hubspot; the grain of this model is deal_id -> field_name -> valid_to.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled','hubspot_deal_property_history_enabled'])) }}

with history as (

    select *
    from {{ var('deal_property_history') }}

), windows as (

    select
        deal_id,
        field_name,
        change_source,
        change_source_id,
        change_timestamp as valid_from,
        new_value,
        lead(change_timestamp) over (partition by deal_id, field_name order by change_timestamp) as valid_to
    from history

), surrogate as (

    select 
        windows.*,
        {{ dbt_utils.generate_surrogate_key(['field_name','deal_id','valid_from']) }} as id
    from windows

)

select *
from surrogate
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
change_source The source (reason) of the change.
change_source_id The ID of the object that caused the change, if applicable.
valid_from The timestamp the change was valid from.
valid_to The timestamp the change was valid to. Null if still valid.
deal_id The ID of the related deal record.
field_name The name of the field being changed.
new_value The new value of the field.
id The ID of the change.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
80. model.hubspot.int_hubspot__contact_merge_adjust
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled', 'hubspot_contact_enabled'])) }}

with contacts as (

    select *
    from {{ var('contact') }}
), contact_merge_audit as (
{% if var('hubspot_contact_merge_audit_enabled', false) %}
    select *
    from {{ var('contact_merge_audit') }}

{% else %}
    {{ merge_contacts() }}

{% endif %}
), contact_merge_removal as (
    select 
        contacts.*
    from contacts
    
    left join contact_merge_audit
        on cast(contacts.contact_id as {{ dbt.type_string() }}) = cast(contact_merge_audit.vid_to_merge as {{ dbt.type_string() }})
    
    where contact_merge_audit.vid_to_merge is null
)

select *
from contact_merge_removal
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
81. model.hubspot.int_hubspot__email_event_aggregates
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled'])) }}

with events as (

    select *
    from {{ var('email_event') }}

), aggregates as (

    select
        sent_by_event_id as email_send_id,
        count(case when event_type = 'OPEN' then sent_by_event_id end) as opens,
        count(case when event_type = 'SENT' then sent_by_event_id end) as sends,
        count(case when event_type = 'DELIVERED' then sent_by_event_id end) as deliveries,
        count(case when event_type = 'DROPPED' then sent_by_event_id end) as drops,
        count(case when event_type = 'CLICK' then sent_by_event_id end) as clicks,
        count(case when event_type = 'FORWARD' then sent_by_event_id end) as forwards,
        count(case when event_type = 'DEFERRED' then sent_by_event_id end) as deferrals,
        count(case when event_type = 'BOUNCE' then sent_by_event_id end) as bounces,
        count(case when event_type = 'SPAMREPORT' then sent_by_event_id end) as spam_reports,
        count(case when event_type = 'PRINT' then sent_by_event_id end) as prints
    from events
    where sent_by_event_id is not null
    group by 1

)

select *
from aggregates
Column Description
column_name description
email_send_id
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
82. model.hubspot.hubspot__email_event_bounce
Model catalog prepared by Cocoon

Model Description
Each record represents a BOUNCE email event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_bounce_enabled'])) }}

{{ email_events_joined(var('email_event_bounce')) }}
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
is_contact_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
bounce_category The best-guess of the type of bounce encountered. \nIf an appropriate category couldn't be determined, this property is omitted. See below for the possible values. \nNote that this is a derived value, and may be modified at any time to improve the accuracy of classification.\n
event_id The ID of the event.
returned_response The full response from the recipient's email server.
returned_status The status code returned from the recipient's email server.
created_timestamp The created timestamp of the event.
email_campaign_id The ID of the related email campaign.
recipient_email_address The email address of the contact related to the event.
email_send_timestamp The timestamp of the SENT event related to this event.
email_send_id The event ID which uniquely identifies the email message's SENT event. If not applicable, this property is omitted.
contact_id The ID of the related contact.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
83. model.hubspot.hubspot__email_event_clicks
Model catalog prepared by Cocoon

Model Description
Each record represents a CLICK email event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_click_enabled'])) }}

{{ email_events_joined(var('email_event_click')) }}
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
is_contact_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
browser A JSON object representing the browser which serviced the event. Its comprised of the properties: 'name', 'family', 'producer', 'producer_url', 'type', 'url', 'version'.
click_url The URL within the message that the recipient clicked.
event_id The ID of the event.
geo_location A JSON object representing the location where the event occurred. It's comprised of the properties: 'city', 'state', 'country'.
ip_address The contact's IP address when the event occurred.
referer_url The URL of the webpage that linked to the URL clicked. Whether this is provided, and what its value is, is determined by the recipient's email client.
user_agent The user agent responsible for the event, e.g. “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36”
created_timestamp The created timestamp of the event.
email_campaign_id The ID of the related email campaign.
recipient_email_address The email address of the contact related to the event.
email_send_timestamp The timestamp of the SENT event related to this event.
email_send_id The event ID which uniquely identifies the email message's SENT event. If not applicable, this property is omitted.
contact_id The ID of the related contact.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
84. model.hubspot.hubspot__email_event_deferred
Model catalog prepared by Cocoon

Model Description
Each record represents a DEFERRED email event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_deferred_enabled'])) }}

{{ email_events_joined(var('email_event_deferred')) }}
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
is_contact_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
attempt_number The delivery attempt number.
event_id The ID of the event.
returned_response The full response from the recipient's email server.
created_timestamp The created timestamp of the event.
email_campaign_id The ID of the related email campaign.
recipient_email_address The email address of the contact related to the event.
email_send_timestamp The timestamp of the SENT event related to this event.
email_send_id The event ID which uniquely identifies the email message's SENT event. If not applicable, this property is omitted.
contact_id The ID of the related contact.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
85. model.hubspot.hubspot__email_event_delivered
Model catalog prepared by Cocoon

Model Description
Each record represents a DELIVERED email event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_delivered_enabled'])) }}

{{ email_events_joined(var('email_event_delivered')) }}
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
is_contact_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
event_id The ID of the event.
returned_response The full response from the recipient's email server.
smtp_id An ID attached to the message by HubSpot.
created_timestamp The created timestamp of the event.
email_campaign_id The ID of the related email campaign.
recipient_email_address The email address of the contact related to the event.
email_send_timestamp The timestamp of the SENT event related to this event.
email_send_id The event ID which uniquely identifies the email message's SENT event. If not applicable, this property is omitted.
contact_id The ID of the related contact.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
86. model.hubspot.hubspot__email_event_dropped
Model catalog prepared by Cocoon

Model Description
Each record represents a DROPPED email event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_dropped_enabled'])) }}

{{ email_events_joined(var('email_event_dropped')) }}
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
is_contact_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
bcc_emails The 'bcc' field of the email message.
cc_emails The 'cc' field of the email message.
drop_message The raw message describing why the email message was dropped. This will usually provide additional details beyond 'dropReason'.
drop_reason The reason why the email message was dropped. See below for the possible values.
email_subject The subject line of the email message.
event_id The ID of the event.
from_email The 'from' field of the email message.
reply_to_email The 'reply-to' field of the email message.
created_timestamp The created timestamp of the event.
email_campaign_id The ID of the related email campaign.
recipient_email_address The email address of the contact related to the event.
email_send_timestamp The timestamp of the SENT event related to this event.
email_send_id The event ID which uniquely identifies the email message's SENT event. If not applicable, this property is omitted.
contact_id The ID of the related contact.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
87. model.hubspot.hubspot__email_event_forward
Model catalog prepared by Cocoon

Model Description
Each record represents a FORWARD email event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_forward_enabled'])) }}

{{ email_events_joined(var('email_event_forward')) }}
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
is_contact_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
browser A JSON object representing the browser which serviced the event. Its comprised of the properties: 'name', 'family', 'producer', 'producer_url', 'type', 'url', 'version'.
event_id The ID of the event.
geo_location A JSON object representing the location where the event occurred. It's comprised of the properties: 'city', 'state', 'country'.
ip_address The contact's IP address when the event occurred.
user_agent The user agent responsible for the event, e.g. “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36”
created_timestamp The created timestamp of the event.
email_campaign_id The ID of the related email campaign.
recipient_email_address The email address of the contact related to the event.
email_send_timestamp The timestamp of the SENT event related to this event.
email_send_id The event ID which uniquely identifies the email message's SENT event. If not applicable, this property is omitted.
contact_id The ID of the related contact.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
88. model.hubspot.hubspot__email_event_opens
Model catalog prepared by Cocoon

Model Description
Each record represents a OPEN email event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_open_enabled'])) }}

{{ email_events_joined(var('email_event_open')) }}
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
is_contact_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
browser A JSON object representing the browser which serviced the event. Its comprised of the properties: 'name', 'family', 'producer', 'producer_url', 'type', 'url', 'version'.
duration_open If provided and nonzero, the approximate number of milliseconds the user had opened the email.
event_id The ID of the event.
geo_location A JSON object representing the location where the event occurred. It's comprised of the properties: 'city', 'state', 'country'.
ip_address The contact's IP address when the event occurred.
user_agent The user agent responsible for the event, e.g. “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36”
created_timestamp The created timestamp of the event.
email_campaign_id The ID of the related email campaign.
recipient_email_address The email address of the contact related to the event.
email_send_timestamp The timestamp of the SENT event related to this event.
email_send_id The event ID which uniquely identifies the email message's SENT event. If not applicable, this property is omitted.
contact_id The ID of the related contact.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
89. model.hubspot.hubspot__email_event_print
Model catalog prepared by Cocoon

Model Description
Each record represents a PRINT email event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_print_enabled'])) }}

{{ email_events_joined(var('email_event_print')) }}
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
is_contact_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
browser A JSON object representing the browser which serviced the event. Its comprised of the properties: 'name', 'family', 'producer', 'producer_url', 'type', 'url', 'version'.
event_id The ID of the event.
geo_location A JSON object representing the location where the event occurred. It's comprised of the properties: 'city', 'state', 'country'.
ip_address The contact's IP address when the event occurred.
user_agent The user agent responsible for the event, e.g. “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36”
created_timestamp The created timestamp of the event.
email_campaign_id The ID of the related email campaign.
recipient_email_address The email address of the contact related to the event.
email_send_timestamp The timestamp of the SENT event related to this event.
email_send_id The event ID which uniquely identifies the email message's SENT event. If not applicable, this property is omitted.
contact_id The ID of the related contact.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
90. model.hubspot.hubspot__email_event_sent
Model catalog prepared by Cocoon

Model Description
Each record represents a SENT email event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_sent_enabled'])) }}

{{ email_events_joined(var('email_event_sent')) }}
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
is_contact_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
bcc_emails The 'cc' field of the email message.
cc_emails The 'bcc' field of the email message.
email_subject The subject line of the email message.
event_id The ID of the event.
from_email The 'from' field of the email message.
reply_to_email The 'reply-to' field of the email message.
created_timestamp The created timestamp of the event.
email_campaign_id The ID of the related email campaign.
recipient_email_address The email address of the contact related to the event.
email_send_timestamp The timestamp of the SENT event related to this event.
email_send_id The event ID which uniquely identifies the email message's SENT event. If not applicable, this property is omitted.
contact_id The ID of the related contact.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
91. model.hubspot.hubspot__email_event_spam_report
Model catalog prepared by Cocoon

Model Description
Each record represents a SPAM_REPORT email event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_spam_report_enabled'])) }}

{{ email_events_joined(var('email_event_spam_report')) }}
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
is_contact_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
event_id The ID of the event.
ip_address The contact's IP address when the event occurred.
user_agent The user agent responsible for the event, e.g. “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36”
created_timestamp The created timestamp of the event.
email_campaign_id The ID of the related email campaign.
recipient_email_address The email address of the contact related to the event.
email_send_timestamp The timestamp of the SENT event related to this event.
email_send_id The event ID which uniquely identifies the email message's SENT event. If not applicable, this property is omitted.
contact_id The ID of the related contact.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
92. model.hubspot.hubspot__email_event_status_change
Model catalog prepared by Cocoon

Model Description
Each record represents a STATUS_CHANGE email event in Hubspot.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_status_change_enabled'])) }}

{{ email_events_joined(var('email_event_status_change')) }}
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
is_contact_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
change_source The source of the subscription change.
event_id The ID of the event.
is_bounced A HubSpot employee explicitly initiated the status change to block messages to the recipient. \n(Note this usage has been deprecated in favor of dropping messages with a 'dropReason' of BLOCKED_ADDRESS.)\n
requested_by_email The email address of the person requesting the change on behalf of the recipient. If not applicable, this property is omitted.
subscription_status The recipient's portal subscription status. \nNote that if this is 'UNSUBSCRIBED', the property 'subscriptions' is not necessarily an empty array, nor are all \nsubscriptions contained in it necessarily going to have their statuses set to 'UNSUBSCRIBED'.)\n
subscriptions An array of JSON objects representing the status of subscriptions for the recipient. \nEach JSON subscription object is comprised of the properties: 'id', 'status'.\n
created_timestamp The created timestamp of the event.
email_campaign_id The ID of the related email campaign.
recipient_email_address The email address of the contact related to the event.
email_send_timestamp The timestamp of the SENT event related to this event.
email_send_id The event ID which uniquely identifies the email message's SENT event. If not applicable, this property is omitted.
contact_id The ID of the related contact.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
93. model.hubspot.hubspot__engagements
Model catalog prepared by Cocoon

Model Description
Each record represents an engagement
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled'])) }}

with engagements as (

    select *
    from {{ var('engagement') }}

{% if fivetran_utils.enabled_vars(['hubspot_engagement_contact_enabled']) %}

), contacts as (

    select *
    from {{ var('engagement_contact') }}

), contacts_agg as (

    select 
        engagement_id,
        {{ fivetran_utils.array_agg('contact_id') }} as contact_ids
    from contacts
    group by 1

{% endif %}

{% if fivetran_utils.enabled_vars(['hubspot_engagement_deal_enabled']) %}

), deals as (

    select *
    from {{ var('engagement_deal') }}
 
), deals_agg as (

    select 
        engagement_id,
        {{ fivetran_utils.array_agg('deal_id') }} as deal_ids
    from deals
    group by 1

{% endif %}

{% if fivetran_utils.enabled_vars(['hubspot_engagement_company_enabled']) %}

), companies as (

    select *
    from {{ var('engagement_company') }}

), companies_agg as (

    select 
        engagement_id,
        {{ fivetran_utils.array_agg('company_id') }} as company_ids
    from companies
    group by 1

{% endif %}

), joined as (

    select 
        {% if fivetran_utils.enabled_vars(['hubspot_engagement_contact_enabled']) %} contacts_agg.contact_ids, {% endif %}
        {% if fivetran_utils.enabled_vars(['hubspot_engagement_deal_enabled']) %} deals_agg.deal_ids, {% endif %}
        {% if fivetran_utils.enabled_vars(['hubspot_engagement_company_enabled']) %} companies_agg.company_ids, {% endif %}
        engagements.*
    from engagements
    {% if fivetran_utils.enabled_vars(['hubspot_engagement_contact_enabled']) %} left join contacts_agg using (engagement_id) {% endif %}
    {% if fivetran_utils.enabled_vars(['hubspot_engagement_deal_enabled']) %} left join deals_agg using (engagement_id) {% endif %}
    {% if fivetran_utils.enabled_vars(['hubspot_engagement_company_enabled']) %} left join companies_agg using (engagement_id) {% endif %}

)

select *
from joined
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
activity_type The engagement's activity type.
created_timestamp A timestamp representing when the engagement was created.
engagement_id The ID of the engagement.
engagement_type One of NOTE, EMAIL, TASK, MEETING, or CALL, the type of the engagement.
is_active Whether the engagement is currently being shown in the UI.
last_updated_timestamp A timestamp in representing when the engagement was last updated.
occurred_timestamp A timestamp in representing the time that the engagement should appear in the timeline.
owner_id The ID of the engagement's owner.
portal_id The hub ID.
contact_ids List of contacts related to the engagement.
deal_ids List of deals related to the engagement.
company_ids List of companies related to the engagement.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
94. model.hubspot.int_hubspot__deals_enhanced
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled'])) }}

with deals as (

    select *
    from {{ var('deal') }}

{% if var('hubspot_merged_deal_enabled', false) %}
), merged_deals as (

    select *
    from {{ var('merged_deal')}}

), aggregate_merged_deals as (

    select
        deal_id,
        {{ fivetran_utils.array_agg("merged_deal_id") }} as merged_deal_ids
    from merged_deals
    group by 1
{% endif %}

), pipelines as (

    select *
    from {{ var('deal_pipeline') }}

), pipeline_stages as (

    select *
    from {{ var('deal_pipeline_stage') }}

{% if var('hubspot_owner_enabled', true) %}
), owners as (

    select *
    from {{ var('owner') }}
{% endif %}

), deal_fields_joined as (

    select 
        deals.*,

        {% if var('hubspot_merged_deal_enabled', false) %}
        aggregate_merged_deals.merged_deal_ids,
        {% endif %}

        coalesce(pipelines.is_deal_pipeline_deleted, false) as is_deal_pipeline_deleted,
        pipelines.pipeline_label,
        pipelines.is_active as is_pipeline_active,
        coalesce(pipeline_stages.is_deal_pipeline_stage_deleted, false) as is_deal_pipeline_stage_deleted,
        pipelines.deal_pipeline_created_at,
        pipelines.deal_pipeline_updated_at,
        pipeline_stages.pipeline_stage_label

        {% if var('hubspot_owner_enabled', true) %}
        , owners.email_address as owner_email_address
        , owners.full_name as owner_full_name
        {% endif %}

    from deals    
    left join pipelines 
        on deals.deal_pipeline_id = pipelines.deal_pipeline_id
    left join pipeline_stages 
        on deals.deal_pipeline_stage_id = pipeline_stages.deal_pipeline_stage_id

    {% if var('hubspot_owner_enabled', true) %}
    left join owners 
        on deals.owner_id = owners.owner_id
    {% endif %}

    {% if var('hubspot_merged_deal_enabled', false) %}
    left join aggregate_merged_deals
        on deals.deal_id = aggregate_merged_deals.deal_id

    left join merged_deals
        on deals.deal_id = merged_deals.merged_deal_id
    where merged_deals.merged_deal_id is null
    {% endif %}
)   

select *
from deal_fields_joined
Column Description
⚠️ Column description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
95. model.hubspot.int_hubspot__email_aggregate_status_change
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_status_change_enabled'])) }}

with base as (

    select *
    from {{ ref('hubspot__email_event_status_change') }}

), aggregates as (

    select
        email_campaign_id,
        email_send_id,
        count(case when subscription_status = 'UNSUBSCRIBED' then 1 end) as unsubscribes
    from base
    where email_send_id is not null
    group by 1,2

)

select *
from aggregates
Column Description
column_name description
email_send_id
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
96. model.hubspot.hubspot__engagement_calls
Model catalog prepared by Cocoon

Model Description
Each record represents a CALL engagement event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_call_enabled','hubspot_engagement_enabled'])) }}

{{ engagements_joined(ref('stg_hubspot__engagement_call')) }}
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
engagement_id The ID of the engagement.
is_active Whether the engagement is currently being shown in the UI.
created_timestamp A timestamp representing when the engagement was created.
occurred_timestamp A timestamp in representing the time that the engagement should appear in the timeline.
owner_id The ID of the engagement's owner.
contact_ids List of contacts related to the engagement.
deal_ids List of deals related to the engagement.
company_ids List of companies related to the engagement.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
97. model.hubspot.hubspot__engagement_emails
Model catalog prepared by Cocoon

Model Description
Each record represents an EMAIL engagement event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_email_enabled','hubspot_engagement_enabled'])) }}

{{ engagements_joined(ref('stg_hubspot__engagement_email')) }}
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
engagement_id The ID of the engagement.
is_active Whether the engagement is currently being shown in the UI.
created_timestamp A timestamp representing when the engagement was created.
occurred_timestamp A timestamp in representing the time that the engagement should appear in the timeline.
owner_id The ID of the engagement's owner.
contact_ids List of contacts related to the engagement.
deal_ids List of deals related to the engagement.
company_ids List of companies related to the engagement.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
98. model.hubspot.hubspot__engagement_meetings
Model catalog prepared by Cocoon

Model Description
Each record represents a MEETING engagement event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_meeting_enabled','hubspot_engagement_enabled'])) }}

{{ engagements_joined(ref('stg_hubspot__engagement_meeting')) }}
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
engagement_id The ID of the engagement.
is_active Whether the engagement is currently being shown in the UI.
created_timestamp A timestamp representing when the engagement was created.
occurred_timestamp A timestamp in representing the time that the engagement should appear in the timeline.
owner_id The ID of the engagement's owner.
contact_ids List of contacts related to the engagement.
deal_ids List of deals related to the engagement.
company_ids List of companies related to the engagement.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
99. model.hubspot.hubspot__engagement_notes
Model catalog prepared by Cocoon

Model Description
Each record represents a NOTE engagement event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_note_enabled','hubspot_engagement_enabled'])) }}

{{ engagements_joined(ref('stg_hubspot__engagement_note')) }}
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
engagement_id The ID of the engagement.
note The body of the note. The body has a limit of 65536 characters.
is_active Whether the engagement is currently being shown in the UI.
created_timestamp A timestamp representing when the engagement was created.
occurred_timestamp A timestamp in representing the time that the engagement should appear in the timeline.
owner_id The ID of the engagement's owner.
contact_ids List of contacts related to the engagement.
deal_ids List of deals related to the engagement.
company_ids List of companies related to the engagement.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
100. model.hubspot.hubspot__engagement_tasks
Model catalog prepared by Cocoon

Model Description
Each record represents a TASK engagement event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_task_enabled','hubspot_engagement_enabled'])) }}

{{ engagements_joined(ref('stg_hubspot__engagement_task')) }}
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
engagement_id The ID of the engagement.
is_active Whether the engagement is currently being shown in the UI.
created_timestamp A timestamp representing when the engagement was created.
occurred_timestamp A timestamp in representing the time that the engagement should appear in the timeline.
owner_id The ID of the engagement's owner.
contact_ids List of contacts related to the engagement.
deal_ids List of deals related to the engagement.
company_ids List of companies related to the engagement.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
101. model.hubspot.int_hubspot__engagement_metrics__by_contact
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_contact_enabled'])) }}

with engagements as (

    select *
    from {{ ref('hubspot__engagements') }}

), engagement_contacts as (

    select *
    from {{ var('engagement_contact') }}

), engagement_contacts_joined as (

    select
        engagements.engagement_type,
        engagement_contacts.contact_id
    from engagements
    inner join engagement_contacts
        using (engagement_id)

), engagement_contacts_agg as (

    {{ engagements_aggregated('engagement_contacts_joined', 'contact_id') }}

)

select *
from engagement_contacts_agg
Column Description
column_name description
contact_id
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
102. model.hubspot.hubspot__companies
Model catalog prepared by Cocoon

Model Description
Each record represents a company in Hubspot.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_company_enabled'])) }}

with companies as (

    select *
    from {{ var('company') }}

{% if fivetran_utils.enabled_vars(['hubspot_engagement_enabled','hubspot_engagement_company_enabled']) %}

), engagements as (

    select *
    from {{ ref('hubspot__engagements') }}

), engagement_companies as (

    select *
    from {{ var('engagement_company') }}

), engagement_companies_joined as (

    select
        engagements.engagement_type,
        engagement_companies.company_id
    from engagements
    inner join engagement_companies
        using (engagement_id)

), engagement_companies_agg as (

    {{ engagements_aggregated('engagement_companies_joined', 'company_id') }}

), joined as (

    select 
        companies.*,
        {% for metric in engagement_metrics() %}
        coalesce(engagement_companies_agg.{{ metric }},0) as {{ metric }} {% if not loop.last %},{% endif %}
        {% endfor %}
    from companies
    left join engagement_companies_agg
        using (company_id)

)

select *
from joined

{% else %}

)

select *
from companies

{% endif %}
Column Description
column_name description
company_id The ID of the company.
portal_id The hub ID.
is_company_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
count_engagement_notes The total number of related note engagements.
count_engagement_tasks The total number of related task engagements.
count_engagement_calls The total number of related call engagements.
count_engagement_meetings The total number of related meeting engagements.
count_engagement_emails The total number of related email engagements.
count_engagement_incoming_emails The total number of related incoming email engagements.
count_engagement_forwarded_emails The total number of related forwarded email engagements.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
103. model.hubspot.hubspot__deal_stages
Model catalog prepared by Cocoon

Model Description
Each record represents when a deal stage changes in Hubspot, enriched with metrics about deal activities
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled'])) }}

with deals_enhanced as (

    select *
    from {{ ref('int_hubspot__deals_enhanced') }}

), deal_stage as (

    select *
    from {{ var('deal_stage') }}

), pipeline_stage as (

    select *
    from {{ var('deal_pipeline_stage') }}

), pipeline as (

    select *
    from {{ var('deal_pipeline') }}

), final as (

    select
        deal_stage.deal_id || '-' || row_number() over(partition by deal_stage.deal_id order by deal_stage.date_entered asc) as deal_stage_id,
        deals_enhanced.deal_id,
        deals_enhanced.deal_name,

        {% if var('hubspot_merged_deal_enabled', false) %}
        deals_enhanced.merged_deal_ids,
        {% endif %}
        
        deal_stage._fivetran_start as date_stage_entered,
        deal_stage._fivetran_end as date_stage_exited,
        deal_stage._fivetran_active as is_stage_active,
        deal_stage.deal_stage_name as pipeline_stage_id,
        pipeline_stage.pipeline_stage_label,
        pipeline_stage.deal_pipeline_id as pipeline_id,
        pipeline.pipeline_label,
        deal_stage.source,
        deal_stage.source_id,
        pipeline_stage.is_active as is_pipeline_stage_active,
        pipeline.is_active as is_pipeline_active,
        pipeline_stage.is_closed_won as is_pipeline_stage_closed_won,
        pipeline_stage.display_order as pipeline_stage_display_order,
        pipeline.display_order as pipeline_display_order,
        pipeline_stage.probability as pipeline_stage_probability,
        coalesce(pipeline.is_deal_pipeline_deleted, false) as is_deal_pipeline_deleted,
        coalesce(pipeline_stage.is_deal_pipeline_stage_deleted, false) as is_deal_pipeline_stage_deleted,
        coalesce(deals_enhanced.is_deal_deleted, false) as is_deal_deleted,
        pipeline_stage.deal_pipeline_stage_created_at,
        pipeline_stage.deal_pipeline_stage_updated_at

    from deal_stage

    left join pipeline_stage
        on deal_stage.deal_stage_name = pipeline_stage.deal_pipeline_stage_id
    
    left join pipeline
        on pipeline_stage.deal_pipeline_id = pipeline.deal_pipeline_id

    left join deals_enhanced
        on deal_stage.deal_id = deals_enhanced.deal_id
)

select * 
from final
Column Description
column_name description
deal_stage_id The unique deal stage identifier.
is_deal_pipeline_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
is_deal_pipeline_stage_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
is_deal_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
pipeline_stage_id The ID of the deal's pipeline stage.
date_stage_entered The timestamp the deal stage was entered.
date_stage_exited The Fivetran calculated exit time of the deal stage.
is_stage_active Boolean indicating whether the deal stage active.
deal_id The ID of the deal.
merged_deal_ids A list of deals that had previously been merged into this record.
pipeline_id The ID of the deal's pipeline.
pipeline_label The label of the deal's pipeline.
is_pipeline_active Boolean indicating if the pipeline is active.
is_pipeline_stage_active Boolean indicating if the pipeline stage is active.
pipeline_stage_label The label of the deal's pipeline stage.
source The relevant source of the deal stage.
source_id Reference to the source.
is_pipeline_stage_closed_won Whether the stage represents a Closed Won deal.
pipeline_stage_display_order Used to determine the order in which the stages appear when viewed in HubSpot.
pipeline_display_order Used to determine the order in which the pipelines appear when viewed in HubSpot.
pipeline_stage_probability The probability that the deal will close. Used for the deal forecast.
deal_name The name you have given this deal.
deal_pipeline_stage_created_at A timestamp representing when the deal_pipeline_stage was created.
deal_pipeline_stage_updated_at A timestamp representing when the deal_pipeline_stage was updated.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
104. model.hubspot.hubspot__deals
Model catalog prepared by Cocoon

Model Description
Each record represents a deal in Hubspot.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled'])) }}

with deals_enhanced as (

    select *
    from {{ ref('int_hubspot__deals_enhanced') }}

{% if fivetran_utils.enabled_vars(['hubspot_engagement_enabled','hubspot_engagement_deal_enabled']) %}

), engagements as (

    select *
    from {{ ref('hubspot__engagements') }}

), engagement_deals as (

    select *
    from {{ var('engagement_deal') }}

), engagement_deal_joined as (

    select
        engagements.engagement_type,
        engagement_deals.deal_id
    from engagements
    inner join engagement_deals
        on cast(engagements.engagement_id as {{ dbt.type_bigint() }}) = cast(engagement_deals.engagement_id as {{ dbt.type_bigint() }} )

), engagement_deal_agg as (

    {{ engagements_aggregated('engagement_deal_joined', 'deal_id') }}

), engagements_joined as (

    select 
        deals_enhanced.*,
        {% for metric in engagement_metrics() %}
        coalesce(engagement_deal_agg.{{ metric }},0) as {{ metric }} {% if not loop.last %},{% endif %}
        {% endfor %}
    from deals_enhanced
    left join engagement_deal_agg
        on cast(deals_enhanced.deal_id as {{ dbt.type_bigint() }}) = cast(engagement_deal_agg.deal_id as {{ dbt.type_bigint() }} )

)

select *
from engagements_joined

{% else %}

)

select *
from deals_enhanced

{% endif %}
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
description A brief description of the deal.
amount The total value of the deal in the deal's currency.
closed_date The day the deal is expected to close, or was closed.
created_date The date the deal was created. This property is set automatically by HubSpot.
deal_id The ID of the deal
deal_name The name you have given this deal.
merged_deal_ids A list of deals that had previously been merged into this record.
is_deal_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
is_deal_pipeline_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
is_deal_pipeline_stage_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
portal_id The hub ID.
deal_pipeline_id The ID of the deal's pipeline.
deal_pipeline_stage_id The ID of the deal's pipeline stage.
owner_id The ID of the deal's owner.
count_engagement_notes The total number of related note engagements.
count_engagement_tasks The total number of related task engagements.
count_engagement_calls The total number of related call engagements.
count_engagement_meetings The total number of related meeting engagements.
count_engagement_emails The total number of related email engagements.
count_engagement_incoming_emails The total number of related incoming email engagements.
count_engagement_forwarded_emails The total number of related forwarded email engagements.
is_pipeline_active Boolean indicating if the pipeline is active.
pipeline_label The label of the deal's pipeline.
pipeline_stage_label The label of the deal's pipeline stage.
owner_email_address The email address of the deal's owner.
owner_full_name The full name of the deal's owner.
deal_pipeline_created_at A timestamp representing when the deal_pipeline was created.
deal_pipeline_updated_at A timestamp representing when the deal_pipeline was updated.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
105. model.hubspot.hubspot__email_sends
Model catalog prepared by Cocoon

Model Description
Each record represents a SENT email event.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_sent_enabled'])) }}

with sends as (

    select *
    from {{ ref('hubspot__email_event_sent') }}

), metrics as (

    select *
    from {{ ref('int_hubspot__email_event_aggregates') }}

), joined as (

    select
        sends.*,
        coalesce(metrics.bounces,0) as bounces,
        coalesce(metrics.clicks,0) as clicks,
        coalesce(metrics.deferrals,0) as deferrals,
        coalesce(metrics.deliveries,0) as deliveries,
        coalesce(metrics.drops,0) as drops,
        coalesce(metrics.forwards,0) as forwards,
        coalesce(metrics.opens,0) as opens,
        coalesce(metrics.prints,0) as prints,
        coalesce(metrics.spam_reports,0) as spam_reports
    from sends
    left join metrics using (email_send_id)

), booleans as (

    select 
        *,
        bounces > 0 as was_bounced,
        clicks > 0 as was_clicked,
        deferrals > 0 as was_deferred,
        deliveries > 0 as was_delivered,
        forwards > 0 as was_forwarded,
        opens > 0 as was_opened,
        prints > 0 as was_printed,
        spam_reports > 0 as was_spam_reported
    from joined

{% if fivetran_utils.enabled_vars(['hubspot_email_event_status_change_enabled']) %}

), unsubscribes as (

    select *
    from {{ ref('int_hubspot__email_aggregate_status_change') }}

), unsubscribes_joined as (

    select 
        booleans.*,
        coalesce(unsubscribes.unsubscribes,0) as unsubscribes,
        coalesce(unsubscribes.unsubscribes,0) > 0 as was_unsubcribed
    from booleans
    left join unsubscribes using (email_send_id)

)

select *
from unsubscribes_joined

{% else %}

)

select *
from booleans

{% endif %}
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
is_contact_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
bcc_emails The 'cc' field of the email message.
cc_emails The 'bcc' field of the email message.
email_subject The subject line of the email message.
event_id The ID of the event.
from_email The 'from' field of the email message.
reply_to_email The 'reply-to' field of the email message.
created_timestamp The created timestamp of the event.
email_campaign_id The ID of the related email campaign.
recipient_email_address The email address of the contact related to the event.
email_send_timestamp The timestamp of the SENT event related to this event.
email_send_id The event ID which uniquely identifies the email message's SENT event. If not applicable, this property is omitted.
contact_id The ID of the related contact.
bounces The total number of bounce email events.
clicks The total number of click email events.
deferrals The total number of deferral email events.
deliveries The total number of delivery email events.
drops The total number of drop email events.
forwards The total number of forward email events.
opens The total number of open email events.
prints The total number of print email events.
spam_reports The total number of spam report email events.
unsubscribes The total number of unsubscribe email events.
was_bounced Whether the email was bounced.
was_clicked Whether the email was clicked.
was_deferred Whether the email was deferred.
was_delivered Whether the email was delivered.
was_forwarded Whether the email was forwarded.
was_opened Whether the email was opened.
was_printed Whether the email was printed.
was_spam_reported Whether the email was spam reported.
was_unsubcribed Whether the email was unsubcribed.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
106. model.hubspot.hubspot__email_campaigns
Model catalog prepared by Cocoon

Model Description
Each record represents an email campaign in Hubspot.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_sent_enabled'])) }}


with campaigns as (

    select *
    from {{ ref('stg_hubspot__email_campaign') }}

), email_sends as (

    select *
    from {{ ref('hubspot__email_sends') }}

), email_metrics as (
    {% set email_metrics = adjust_email_metrics('hubspot__email_sends', 'email_metrics') %}
    select 
        email_campaign_id,
        {% for metric in email_metrics %}
        sum(email_sends.{{ metric }}) as total_{{ metric }},
        count(distinct case when email_sends.{{ metric }} > 0 then email_send_id end) as total_unique_{{ metric }}
        {% if not loop.last %},{% endif %}
        {% endfor %}
    from email_sends
    group by 1

), joined as (

    select 
        campaigns.*,
        {% for metric in email_metrics %}
        coalesce(email_metrics.total_{{ metric }}, 0) as total_{{ metric }},
        coalesce(email_metrics.total_unique_{{ metric }}, 0) as total_unique_{{ metric }}
        {% if not loop.last %},{% endif %}
        {% endfor %}
    from campaigns
    left join email_metrics
        on campaigns.email_campaign_id = email_metrics.email_campaign_id

)

select *
from joined
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
app_id The app ID.
app_name The app name.
content_id The ID of the content.
email_campaign_id The ID of the email campaign.
email_campaign_name The name of the email campaign.
email_campaign_sub_type The email campaign sub-type.
email_campaign_subject The subject of the email campaign.
email_campaign_type The email campaign type.
num_included The number of messages included as part of the email campaign.
num_queued The number of messages queued as part of the email campaign.
total_bounces The total number of bounce email events.
total_clicks The total number of click email events.
total_deferrals The total number of deferral email events.
total_deliveries The total number of delivery email events.
total_drops The total number of drop email events.
total_forwards The total number of forward email events.
total_opens The total number of open email events.
total_prints The total number of print email events.
total_spam_reports The total number of spam report email events.
total_unsubscribes The total number of unsubscribe email events.
total_unique_bounces The total number of unique email sends with a bounce email event.
total_unique_clicks The total number of unique email sends with a click email event.
total_unique_deferrals The total number of unique email sends with a deferral email event.
total_unique_deliveries The total number of unique email sends with a delivery email event.
total_unique_drops The total number of unique email sends with a drop email event.
total_unique_forwards The total number of unique email sends with a forward email event.
total_unique_opens The total number of unique email sends with a opens email event.
total_unique_prints The total number of unique email sends with a print email event.
total_unique_spam_reports The total number of unique email sends with a spam report email event.
total_unique_unsubscribes The total number of unique email sends with a unsubscribe email event.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
107. model.hubspot.int_hubspot__email_metrics__by_contact_list
Model catalog prepared by Cocoon

Model Description
⚠️ Model description is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_contact_list_member_enabled','hubspot_contact_enabled','hubspot_email_event_sent_enabled']), materialized='table') }}

with email_sends as (

    select *
    from {{ ref('hubspot__email_sends') }}

), contact_list_member as (

    select *
    from {{ var('contact_list_member') }}

), joined as (

    select
        email_sends.*,
        contact_list_member.contact_list_id
    from email_sends
    left join contact_list_member
        using (contact_id)
    where contact_list_member.contact_list_id is not null

), email_metrics as (
    {% set email_metrics = adjust_email_metrics('hubspot__email_sends', 'email_metrics') %}
    select 
        contact_list_id,
        {% for metric in email_metrics %}
        sum({{ metric }}) as total_{{ metric }},
        count(distinct case when {{ metric }} > 0 then email_send_id end) as total_unique_{{ metric }}
        {% if not loop.last %},{% endif %}
        {% endfor %}
    from joined
    group by 1

)

select *
from email_metrics
Column Description
column_name description
contact_list_id
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
108. model.hubspot.hubspot__contacts
Model catalog prepared by Cocoon

Model Description
Each record represents a contact in Hubspot.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled', 'hubspot_contact_enabled'])) }}
{% set emails_enabled = fivetran_utils.enabled_vars(['hubspot_marketing_enabled', 'hubspot_email_event_enabled', 'hubspot_email_event_sent_enabled']) %}
{% set engagements_enabled = fivetran_utils.enabled_vars(['hubspot_sales_enabled', 'hubspot_engagement_enabled','hubspot_engagement_contact_enabled']) %}

with contacts as (

    select *
    from {{ ref('int_hubspot__contact_merge_adjust') }} 
{% if emails_enabled %}

), email_sends as (

    select *
    from {{ ref('hubspot__email_sends') }}

), email_metrics as (
    {% set email_metrics = adjust_email_metrics('hubspot__email_sends', 'email_metrics') %}
    select 
        recipient_email_address,
        {% for metric in email_metrics %}
        sum({{ metric }}) as total_{{ metric }},
        count(distinct case when {{ metric }} > 0 then email_send_id end) as total_unique_{{ metric }}
        {% if not loop.last %},{% endif %}
        {% endfor %}
    from email_sends
    group by 1

), email_joined as (

    select 
        contacts.*,
        {% for metric in email_metrics %}
        coalesce(email_metrics.total_{{ metric }}, 0) as total_{{ metric }},
        coalesce(email_metrics.total_unique_{{ metric }}, 0) as total_unique_{{ metric }}
        {% if not loop.last %},{% endif %}
        {% endfor %}
    from contacts
    left join email_metrics
        on contacts.email = email_metrics.recipient_email_address

{% endif %}

{% if engagements_enabled %}

{% set cte_ref = 'email_joined' if emails_enabled else 'contacts' %}

), engagements as (

    select *
    from {{ ref('int_hubspot__engagement_metrics__by_contact') }}

), engagements_joined as (

    select 
        {{ cte_ref }}.*,
        {% for metric in engagement_metrics() %}
        coalesce(engagements.{{ metric }},0) as {{ metric }} {% if not loop.last %},{% endif %}
        {% endfor %}
    from {{ cte_ref }}
    left join engagements
        using (contact_id)

)

select *
from engagements_joined

{% elif emails_enabled %}

)

select *
from email_joined

{% else %}

)

select *
from contacts

{% endif %}
Column Description
column_name description
is_contact_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
_fivetran_synced Timestamp of when Fivetran synced a record.
contact_id The ID of the contact.
contact_company The name of the contact's company
first_name The contact's first name.
last_name The contact's last name.
email The email address of the contact.
created_date The date that the contact was created in your HubSpot account.
job_title The contact's job title.
company_annual_revenue The contact's annual company revenue.
total_bounces The total number of bounce email events.
total_clicks The total number of click email events.
total_deferrals The total number of deferral email events.
total_deliveries The total number of delivery email events.
total_drops The total number of drop email events.
total_forwards The total number of forward email events.
total_opens The total number of open email events.
total_prints The total number of print email events.
total_spam_reports The total number of spam report email events.
total_unsubscribes The total number of unsubscribe email events.
total_unique_bounces The total number of unique email sends with a bounce email event.
total_unique_clicks The total number of unique email sends with a click email event.
total_unique_deferrals The total number of unique email sends with a deferral email event.
total_unique_deliveries The total number of unique email sends with a delivery email event.
total_unique_drops The total number of unique email sends with a drop email event.
total_unique_forwards The total number of unique email sends with a forward email event.
total_unique_opens The total number of unique email sends with a opens email event.
total_unique_prints The total number of unique email sends with a print email event.
total_unique_spam_reports The total number of unique email sends with a spam report email event.
total_unique_unsubscribes The total number of unique email sends with a unsubscribe email event.
count_engagement_notes The total number of related note engagements.
count_engagement_tasks The total number of related task engagements.
count_engagement_calls The total number of related call engagements.
count_engagement_meetings The total number of related meeting engagements.
count_engagement_emails The total number of related email engagements.
count_engagement_incoming_emails The total number of related incoming email engagements.
count_engagement_forwarded_emails The total number of related forwarded email engagements.
calculated_merged_vids List of mappings representing contact IDs that have been merged into the contact at hand. Format: <merged_contact_id>:<merged_at_in_epoch_time>;<second_merged_contact_id>:<merged_at_in_epoch_time> This field has replaced the `CONTACT_MERGE_AUDIT` table, which was deprecated by the Hubspot v3 CRM API.\n
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
109. model.hubspot.hubspot__contact_lists
Model catalog prepared by Cocoon

Model Description
Each record represents a contact list in Hubspot.
SQL
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_contact_list_enabled'])) }}

with contact_lists as (

    select *
    from {{ var('contact_list') }}

{% if fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_contact_enabled','hubspot_contact_list_member_enabled','hubspot_email_event_sent_enabled']) %}

), email_metrics as (

    select *
    from {{ ref('int_hubspot__email_metrics__by_contact_list') }}

), joined as (
    {% set email_metrics = adjust_email_metrics('hubspot__email_sends', 'email_metrics') %}
    select 
        contact_lists.*,
        {% for metric in email_metrics %}
        coalesce(email_metrics.total_{{ metric }}, 0) as total_{{ metric }},
        coalesce(email_metrics.total_unique_{{ metric }}, 0) as total_unique_{{ metric }}
        {% if not loop.last %},{% endif %}
        {% endfor %}
    from contact_lists
    left join email_metrics
        using (contact_list_id)

)

select *
from joined

{% else %}

)

select *
from contact_lists

{% endif %}
Column Description
column_name description
_fivetran_synced Timestamp of when Fivetran synced a record.
contact_list_id The ID of the contact list.
contact_list_name The name of the contact list.
is_contact_list_deleted Boolean indicating whether a record has been deleted in Hubspot and/or inferred deleted in Hubspot by Fivetran; _fivetran_deleted and is_deleted fields are equivalent.
created_timestamp A timestamp of the time the list was created.
is_deletable If this is false, this is a system list and cannot be deleted.
is_dynamic Whether the contact list is dynamic.
metadata_error Any errors that happened the last time the list was processed.
metadata_last_processing_state_change_at A timestamp of the last time that the processing state changed.
metadata_last_size_change_at A timestamp of the last time that the size of the list changed.
metadata_processing One of DONE, REFRESHING, INITIALIZING, or PROCESSING. \nDONE indicates the list has finished processing, any other value indicates that list membership is being evaluated.\n
metadata_size The approximate number of contacts in the list.
portal_id The hub ID.
updated_timestamp A timestamp of the time that the list was last modified.
total_bounces The total number of bounce email events.
total_clicks The total number of click email events.
total_deferrals The total number of deferral email events.
total_deliveries The total number of delivery email events.
total_drops The total number of drop email events.
total_forwards The total number of forward email events.
total_opens The total number of open email events.
total_prints The total number of print email events.
total_spam_reports The total number of spam report email events.
total_unsubscribes The total number of unsubscribe email events.
total_unique_bounces The total number of unique email sends with a bounce email event.
total_unique_clicks The total number of unique email sends with a click email event.
total_unique_deferrals The total number of unique email sends with a deferral email event.
total_unique_deliveries The total number of unique email sends with a delivery email event.
total_unique_drops The total number of unique email sends with a drop email event.
total_unique_forwards The total number of unique email sends with a forward email event.
total_unique_opens The total number of unique email sends with a opens email event.
total_unique_prints The total number of unique email sends with a print email event.
total_unique_spam_reports The total number of unique email sends with a spam report email event.
total_unique_unsubscribes The total number of unique email sends with a unsubscribe email event.
Column Lineage
⚠️ Column lineage is missing from the provided dbt project.
🚀 Run Cocoon Deep RAG to automatically generate it for better RAG.
2. Salesforce Data Warehouse Tables

%3 stg_sf_lead_data_0 stg_sf_lead_data stg_sf_user_data_3 stg_sf_user_data stg_sf_lead_data_0->stg_sf_user_data_3 stg_sf_lead_data_0->stg_sf_user_data_3 stg_sf_lead_data_0->stg_sf_user_data_3 stg_sf_opportunity_data_9 stg_sf_opportunity_data stg_sf_lead_data_0->stg_sf_opportunity_data_9 stg_sf_contact_data_10 stg_sf_contact_data stg_sf_lead_data_0->stg_sf_contact_data_10 stg_sf_account_data_11 stg_sf_account_data stg_sf_lead_data_0->stg_sf_account_data_11 stg_sf_lead_data_0->stg_sf_account_data_11 stg_sf_lead_data_0->stg_sf_account_data_11 stg_sf_task_data_1 stg_sf_task_data stg_sf_task_data_1->stg_sf_user_data_3 stg_sf_task_data_1->stg_sf_user_data_3 stg_sf_task_data_1->stg_sf_user_data_3 stg_sf_task_data_1->stg_sf_contact_data_10 stg_sf_task_data_1->stg_sf_account_data_11 stg_sf_event_data_2 stg_sf_event_data stg_sf_event_data_2->stg_sf_user_data_3 stg_sf_event_data_2->stg_sf_user_data_3 stg_sf_event_data_2->stg_sf_user_data_3 stg_sf_event_data_2->stg_sf_account_data_11 stg_sf_user_data_3->stg_sf_user_data_3 stg_sf_user_data_3->stg_sf_user_data_3 stg_sf_user_role_data_6 stg_sf_user_role_data stg_sf_user_data_3->stg_sf_user_role_data_6 stg_sf_order_data_4 stg_sf_order_data stg_sf_order_data_4->stg_sf_user_data_3 stg_sf_order_data_4->stg_sf_user_data_3 stg_sf_order_data_4->stg_sf_user_data_3 stg_sf_order_data_4->stg_sf_user_data_3 stg_sf_order_data_4->stg_sf_account_data_11 stg_sf_order_data_4->stg_sf_account_data_11 snapshot_sf_account_history_data_5 snapshot_sf_account_history_data snapshot_sf_account_history_data_5->stg_sf_user_data_3 snapshot_sf_account_history_data_5->stg_sf_account_data_11 snapshot_sf_account_history_data_5->stg_sf_account_data_11 stg_sf_user_role_data_6->stg_sf_user_data_3 stg_sf_user_role_data_6->stg_sf_user_role_data_6 stg_sf_product_2_data_7 stg_sf_product_2_data stg_sf_product_2_data_7->stg_sf_user_data_3 stg_sf_product_2_data_7->stg_sf_user_data_3 snapshot_sf_contact_history_data_8 snapshot_sf_contact_history_data snapshot_sf_contact_history_data_8->stg_sf_user_data_3 snapshot_sf_contact_history_data_8->stg_sf_user_data_3 snapshot_sf_contact_history_data_8->stg_sf_contact_data_10 snapshot_sf_contact_history_data_8->stg_sf_contact_data_10 snapshot_sf_contact_history_data_8->stg_sf_account_data_11 stg_sf_opportunity_data_9->stg_sf_user_data_3 stg_sf_opportunity_data_9->stg_sf_account_data_11 stg_sf_contact_data_10->stg_sf_user_data_3 stg_sf_contact_data_10->stg_sf_user_data_3 stg_sf_contact_data_10->stg_sf_user_data_3 stg_sf_contact_data_10->stg_sf_account_data_11 stg_sf_account_data_11->stg_sf_user_data_3 stg_sf_account_data_11->stg_sf_account_data_11 stg_sf_opportunity_history_data_12 stg_sf_opportunity_history_data stg_sf_opportunity_history_data_12->stg_sf_user_data_3 stg_sf_opportunity_history_data_12->stg_sf_opportunity_data_9 stg_sf_opportunity_history_data_12->stg_sf_account_data_11 stg_sf_opportunity_line_item_data_13 stg_sf_opportunity_line_item_data stg_sf_opportunity_line_item_data_13->stg_sf_user_data_3 stg_sf_opportunity_line_item_data_13->stg_sf_user_data_3 stg_sf_opportunity_line_item_data_13->stg_sf_product_2_data_7 stg_sf_opportunity_line_item_data_13->stg_sf_opportunity_data_9
1. stg_sf_user_role_data
Table catalog prepared by Cocoon
version: 2
models:
- name: stg_sf_user_role_data
  description: The table is about user roles in a system, likely Salesforce. It contains
    details such as role names, developer names, access levels for different objects
    (case, contact, opportunity), parent role IDs, and forecast-related permissions.
    Each row represents a distinct user role with its specific settings and permissions.
    The table also includes metadata fields like "_fivetran_deleted" and "_fivetran_active"
    for tracking data synchronization status.
  columns:
  - name: is_deleted
    description: Indicates if the record has been deleted
    tests:
    - not_null
  - name: case_access_level
    description: Access level for case objects for account owners
    tests:
    - not_null
  - name: contact_access_level
    description: Access level for contact objects for account owners
    tests:
    - not_null
    - accepted_values:
        values:
        - fc4SIASWnVauLgJFy3VNNQ==
    cocoon_meta:
      future_accepted_values:
      - None
      - Read
      - Edit
      - Full
  - name: api_name
    description: Unique name used in API and managed packages
    tests:
    - not_null
    - unique
    cocoon_meta:
      unique_reason: This column represents the unique name used in API and managed
        packages. For this table, each row represents a distinct user role. The api_name
        is likely unique across rows as it's used for programmatic access.
  - name: role_id
    description: Unique identifier for the role
    tests:
    - not_null
    - unique
    cocoon_meta:
      unique_reason: This column is the unique identifier for the role. For this table,
        each row represents a distinct user role. The role_id is designed to be a
        unique identifier for each role, making it unique across rows.
  - name: can_manager_share_forecast
    description: Indicates if manager can share forecast
    tests:
    - not_null
  - name: role_name
    description: Display name of the role
    tests:
    - not_null
  - name: opportunity_access_level
    description: Access level for opportunity objects for account owners
    tests:
    - not_null
    - accepted_values:
        values:
        - fc4SIASWnVauLgJFy3VNNQ==
    cocoon_meta:
      future_accepted_values:
      - Read
      - Edit
      - Create
      - Delete
      - Full Access
      - No Access
  - name: parent_role_id
    description: ID of the parent role in hierarchy
    tests:
    - not_null
  - name: portal_type
    description: Type of portal associated with the role
    tests:
    - not_null
    - accepted_values:
        values:
        - at+X+DrPZFPUpqSxBw83VA==
    cocoon_meta:
      future_accepted_values:
      - Customer
      - Employee
      - Admin
      - Partner
      - Vendor
      - Public
      - Internal
      - External
      - Self-service
      - Support
      - Sales
      - Marketing
      - HR
      - Finance
      - IT
  - name: rollup_description
    description: Description for roll-up summary calculations
    tests:
    - not_null
  - name: is_active
    description: Indicates if the record is currently active
    tests:
    - not_null
  - name: forecast_user_id
    description: ID of the user associated with forecasting
    tests:
    - not_null
  tests: []
2. stg_sf_order_data
Table catalog prepared by Cocoon
version: 2
models:
- name: stg_sf_order_data
  description: The table is about sales orders. It includes order details like ID,
    account, billing and shipping addresses, status, amounts, and dates. The table
    also contains information about NetSuite integration, tax calculations, billing
    preferences, and custom fields. Each row represents a unique order with various
    attributes related to its processing, payment, and fulfillment.
  columns:
  - name: order_id
    description: Unique identifier for the sales order
    tests:
    - not_null
    - unique
    cocoon_meta:
      unique_reason: This column represents a unique identifier for each sales order.
        For this table, each row is a distinct order, and order_id appears to be unique
        across rows.
  - name: account_id
    description: Unique identifier for the customer account
    tests:
    - not_null
  - name: activator_id
    description: ID of user who activated the account
    tests:
    - not_null
  - name: billing_city
    description: City for billing address
    tests:
    - not_null
  - name: billing_country
    description: Country for billing address
    tests:
    - not_null
  - name: billing_postal_code
    description: Postal code for billing address
    tests:
    - not_null
  - name: billing_state
    description: State for billing address
    tests:
    - not_null
    - accepted_values:
        values:
        - Florida
        - Maryland
        - New York
    cocoon_meta:
      future_accepted_values:
      - Alabama
      - Alaska
      - Arizona
      - Arkansas
      - California
      - Colorado
      - Connecticut
      - Delaware
      - Georgia
      - Hawaii
      - Idaho
      - Illinois
      - Indiana
      - Iowa
      - Kansas
      - Kentucky
      - Louisiana
      - Maine
      - Massachusetts
      - Michigan
      - Minnesota
      - Mississippi
      - Missouri
      - Montana
      - Nebraska
      - Nevada
      - New Hampshire
      - New Jersey
      - New Mexico
      - North Carolina
      - North Dakota
      - Ohio
      - Oklahoma
      - Oregon
      - Pennsylvania
      - Rhode Island
      - South Carolina
      - South Dakota
      - Tennessee
      - Texas
      - Utah
      - Vermont
      - Virginia
      - Washington
      - West Virginia
      - Wisconsin
      - Wyoming
  - name: created_by_id
    description: ID of user who created the record
    tests:
    - not_null
  - name: is_deleted
    description: Indicates if the record is deleted
    tests:
    - not_null
  - name: is_reduction_order
    description: Indicates if order is a reduction
    tests:
    - not_null
  - name: last_modified_by_id
    description: ID of user who last modified the record
    tests:
    - not_null
  - name: owner_id
    description: ID of the order owner
    tests:
    - not_null
  - name: pricebook_id
    description: ID of the associated price book
    tests:
    - not_null
  - name: shipping_city
    description: City for shipping address
    tests:
    - not_null
  - name: shipping_country
    description: Country for shipping address
    tests:
    - not_null
  - name: shipping_state
    description: State for shipping address
    tests:
    - not_null
    - accepted_values:
        values:
        - Florida
        - New York
        - Maryland
    cocoon_meta:
      future_accepted_values:
      - Alabama
      - Alaska
      - Arizona
      - Arkansas
      - California
      - Colorado
      - Connecticut
      - Delaware
      - Georgia
      - Hawaii
      - Idaho
      - Illinois
      - Indiana
      - Iowa
      - Kansas
      - Kentucky
      - Louisiana
      - Maine
      - Massachusetts
      - Michigan
      - Minnesota
      - Mississippi
      - Missouri
      - Montana
      - Nebraska
      - Nevada
      - New Hampshire
      - New Jersey
      - New Mexico
      - North Carolina
      - North Dakota
      - Ohio
      - Oklahoma
      - Oregon
      - Pennsylvania
      - Rhode Island
      - South Carolina
      - South Dakota
      - Tennessee
      - Texas
      - Utah
      - Vermont
      - Virginia
      - Washington
      - West Virginia
      - Wisconsin
      - Wyoming
  - name: shipping_street
    description: Street address for shipping
    tests:
    - not_null
  - name: status
    description: ''
    tests:
    - not_null
    - accepted_values:
        values:
        - Activated
    cocoon_meta:
      future_accepted_values:
      - Deactivated
      - Pending
  - name: order_status_code
    description: Code representing the order status
    tests:
    - not_null
    - accepted_values:
        values:
        - Activated
    cocoon_meta:
      future_accepted_values:
      - Pending
      - Processing
      - Shipped
      - Delivered
      - Cancelled
      - Returned
      - Refunded
      - On Hold
      - Backordered
  - name: total_amount
    description: Total amount of the order
    tests:
    - not_null
  - name: order_type
    description: Type of the order
    tests:
    - not_null
    - accepted_values:
        values:
        - New
    cocoon_meta:
      future_accepted_values:
      - Existing
      - Renewal
      - Upgrade
      - Downgrade
      - Cancellation
      - Refund
      - Exchange
      - Return
      - Subscription
      - One-time
      - Recurring
      - Bulk
      - Custom
  - name: netsuite_celigo_update
    description: Flag for Celigo NetSuite connection update
    tests:
    - not_null
  - name: netsuite_internal_id
    description: NetSuite internal ID for the order
    tests:
    - not_null
  - name: pushed_from_netsuite
    description: Indicates if order was pushed from NetSuite
    tests:
    - not_null
  - name: netsuite_conn_net_suite_order_status_c
    description: ''
    tests:
    - not_null
    - accepted_values:
        values:
        - Pending Approval
        - Pending Billing
    cocoon_meta:
      future_accepted_values:
      - Approved
      - Billed
      - Cancelled
      - Closed
      - Fulfilled
      - In Production
      - Partially Fulfilled
      - Pending Fulfillment
      - Pending Receipt
      - Received
      - Rejected
  - name: sync_in_progress
    description: Indicates if synchronization is in progress
    tests:
    - not_null
  - name: tax_total
    description: Total tax amount for the order
    tests:
    - not_null
  - name: push_to_netsuite
    description: Indicates if order should be pushed to NetSuite
    tests:
    - not_null
  - name: subtotal
    description: Subtotal amount of the order
    tests:
    - not_null
  - name: order_total
    description: Total amount of the order
    tests:
    - not_null
  - name: netsuite_conn_net_suite_order_number_c
    description: ''
    tests:
    - not_null
  - name: is_contracted
    description: Indicates if the order is contracted
    tests:
    - not_null
  - name: contracting_method
    description: Method used for contracting
    tests:
    - not_null
    - accepted_values:
        values:
        - By Subscription End Date
    cocoon_meta:
      future_accepted_values:
      - Fixed Price
      - Time and Materials
      - Cost Plus
      - Performance-Based
      - Indefinite Delivery/Indefinite Quantity (IDIQ)
      - Blanket Purchase Agreement (BPA)
      - Firm Fixed Price (FFP)
      - Cost Plus Fixed Fee (CPFF)
      - Cost Plus Incentive Fee (CPIF)
      - Cost Plus Award Fee (CPAF)
      - Labor Hour
      - Level of Effort
  - name: payment_terms
    description: Payment terms for the order
    tests:
    - not_null
    - accepted_values:
        values:
        - Net 30
    cocoon_meta:
      future_accepted_values:
      - Net 60
      - Net 90
      - Due on Receipt
      - Cash on Delivery (COD)
      - 2/10 Net 30
      - 1/10 Net 30
      - 2% 10, Net 30
      - Net 15
      - Net 45
      - Net 7
      - EOM (End of Month)
      - PIA (Payment in Advance)
      - 50% Upfront, 50% on Delivery
      - Installment Plan
  - name: price_calc_status
    description: Status of price calculation
    tests:
    - not_null
    - accepted_values:
        values:
        - Not Needed
    cocoon_meta:
      future_accepted_values:
      - Pending
      - In Progress
      - Completed
      - Failed
      - Awaiting Input
      - Cancelled
      - On Hold
  - name: quote_id
    description: Unique identifier for the quote
    tests:
    - not_null
  - name: tax_status_message
    description: Tax calculation status message
    tests:
    - not_null
    - accepted_values:
        values:
        - No Tax Required
        - Tax Amount Is Up To Date
    cocoon_meta:
      future_accepted_values:
      - Tax Calculation Pending
      - Tax Amount Needs Updating
      - Tax Exempt
      - Tax Calculation Error
      - Awaiting Tax Information
      - Tax Rate Changed
      - Tax Refund Due
      - Additional Tax Due
      - Tax Under Review
      - Tax Adjustment Required
  - name: is_seller_importer_of_record
    description: Indicates if seller is importer of record
    tests:
    - not_null
  - name: calculate_tax
    description: Flag to calculate tax for the order
    tests:
    - not_null
  - name: bill_now
    description: Flag to bill immediately
    tests:
    - not_null
  - name: billing_account_id
    description: Account associated with billing
    tests:
    - not_null
  - name: billing_day
    description: Day of month for billing
    tests:
    - not_null
  - name: invoice_batch_category
    description: Batch category for invoicing
    tests:
    - not_null
    - accepted_values:
        values:
        - Daily
        - Domestic (US)
    cocoon_meta:
      future_accepted_values:
      - Weekly
      - Monthly
      - Quarterly
      - Annually
      - International
      - Corporate
      - Small Business
      - Enterprise
      - Government
      - Non-profit
      - Urgent
      - Standard
      - Custom
  - name: credit_summary
    description: Summary of credits applied to order
    tests:
    - not_null
  - name: is_evergreen
    description: Indicates if order is evergreen (auto-renewing)
    tests:
    - not_null
  - name: invoicing_type
    description: Type of invoicing for the order
    tests:
    - not_null
    - accepted_values:
        values:
        - Other
        - Prepaid Credits
    cocoon_meta:
      future_accepted_values:
      - Standard Invoice
      - Credit Card
      - PayPal
      - Bank Transfer
      - Cash on Delivery
      - Subscription
      - Installment
      - Net 30
      - Net 60
      - Net 90
  - name: legal_entity
    description: Legal entity associated with the order
    tests:
    - not_null
  - name: prepaid_billing_frequency
    description: Billing frequency for prepaid orders
    tests:
    - not_null
    - accepted_values:
        values:
        - Annual
    cocoon_meta:
      future_accepted_values:
      - Monthly
      - Quarterly
      - Semi-Annual
      - Weekly
      - Bi-Weekly
      - Daily
  - name: is_prepaid
    description: Indicates if the order is prepaid
    tests:
    - not_null
  - name: update_subscriptions_only
    description: Flag for updating subscriptions only
    tests:
    - not_null
  - name: auto_activated
    description: Indicates if order was automatically activated
    tests:
    - not_null
  - name: synced_to_netsuite
    description: Whether order is synced to NetSuite
    tests:
    - not_null
  - name: celigo_sfnsio_net_suite_order_number_c
    description: ''
    tests:
    - not_null
  - name: netsuite_record_id
    description: NetSuite record identifier for integration
    tests:
    - not_null
  - name: skip_netsuite_export
    description: Flag to skip exporting to NetSuite
    tests:
    - not_null
  - name: is_test_mode
    description: Indicates if the record is in test mode
    tests:
    - not_null
  - name: has_rollover_spend_amendment
    description: Flag for rollover spend type amendment
    tests:
    - not_null
  - name: activation_datetime
    description: Date and time when the account was activated
    tests:
    - not_null
  - name: amendment_type
    description: Type of amendment made to the order
    tests:
    - not_null
  - name: billing_state_code
    description: State code for billing address
    tests:
    - not_null
  - name: created_date
    description: Date and time when record was created
    tests:
    - not_null
  - name: effective_date
    description: Date when order becomes effective
    tests:
    - not_null
  - name: end_date
    description: End date of the order
    tests:
    - not_null
  - name: invoice_message
    description: Invoice-related message
    tests:
    - not_null
  - name: is_active
    description: Indicates if the record is active in Fivetran
    tests:
    - not_null
  - name: last_modified_date
    description: Date and time of last modification
    tests:
    - not_null
  - name: last_modified_timestamp
    description: Timestamp of last system modification
    tests:
    - not_null
  - name: netsuite_id
    description: NetSuite ID for the order
    tests:
    - not_null
  - name: order_date
    description: Date and time the order was created
    tests:
    - not_null
  - name: order_number
    description: Unique identifier for the order
    tests:
    - not_null
    - unique
    cocoon_meta:
      unique_reason: This column appears to be a unique identifier for each order,
        similar to order_id. It's populated for all rows and seems to be unique across
        the given samples.
  - name: shipping_postal_code
    description: Postal code for shipping address
    tests:
    - not_null
  - name: tracking_numbers
    description: Shipping tracking numbers
    tests:
    - not_null
  tests: []
3. stg_sf_event_data
Table catalog prepared by Cocoon
version: 2
models:
- name: stg_sf_event_data
  description: The table is about Salesforce event data. It contains details of various
    events like calls and meetings. Each event has an ID, account ID, date, duration,
    type, and associated contact. Additional fields track recurrence, privacy settings,
    and sales-related information. The table also includes system fields for creation
    and modification timestamps.
  columns:
  - name: event_id
    description: Unique identifier for the event
    tests:
    - not_null
    - unique
    cocoon_meta:
      unique_reason: This column represents a unique identifier for each event. For
        this table, each row is for a specific event. The event_id is unique across
        rows as it's designed to be a primary identifier for events in Salesforce.
  - name: account_id
    description: Unique identifier for the associated account
    tests:
    - not_null
  - name: created_by_id
    description: ID of the user who created the record
    tests:
    - not_null
  - name: description
    description: Description of the event or activity
    tests:
    - not_null
  - name: duration_minutes
    description: Duration of the event in minutes
    tests:
    - not_null
  - name: event_subtype
    description: Subtype of the event
    tests:
    - not_null
  - name: group_event_type
    description: Type of group event (1.0 indicates a group event)
    tests:
    - not_null
  - name: is_child_event
    description: Indicates if the event is a child event
    tests:
    - not_null
  - name: is_deleted
    description: Indicates if the event is deleted
    tests:
    - not_null
  - name: is_group_event
    description: Indicates if it's a group event
    tests:
    - not_null
  - name: is_private
    description: Indicates if the event is private
    tests:
    - not_null
  - name: is_recurring
    description: Indicates if the event is recurring
    tests:
    - not_null
  - name: has_reminder
    description: Indicates if a reminder is set
    tests:
    - not_null
  - name: last_modified_by_id
    description: ID of user who last modified the event
    tests:
    - not_null
  - name: is_no_show
    description: Indicates if it was a no-show
    tests:
    - not_null
  - name: owner_id
    description: ID of the event owner
    tests:
    - not_null
  - name: show_as
    description: How the event appears on calendar
    tests:
    - not_null
    - accepted_values:
        values:
        - Busy
    cocoon_meta:
      future_accepted_values:
      - Free
      - Tentative
      - Out of Office
      - Working Elsewhere
      - Available
  - name: event_type
    description: Type of the event (e.g., Call, Meeting)
    tests:
    - not_null
    - accepted_values:
        values:
        - Call
        - Meeting
    cocoon_meta:
      future_accepted_values:
      - Conference
      - Webinar
      - Workshop
      - Training
      - Presentation
      - Interview
      - Team Building
      - Brainstorming
      - Project Kickoff
      - Review
      - Client Meeting
      - Board Meeting
      - All Hands
      - One-on-One
      - Lunch and Learn
      - Networking Event
      - Product Demo
      - Strategy Session
  - name: what_count
    description: Count of associated 'what' objects
    tests:
    - not_null
  - name: what_id
    description: ID of the associated 'what' object
    tests:
    - not_null
  - name: who_count
    description: Count of associated 'who' objects
    tests:
    - not_null
  - name: who_id
    description: ID of the associated 'who' object
    tests:
    - not_null
  - name: is_recurring_secondary
    description: Secondary indicator for recurrence
    tests:
    - not_null
  - name: is_recurring_secondary_exception
    description: Indicates exception in secondary recurrence
    tests:
    - not_null
  - name: is_recurring_secondary_exclusion
    description: Indicates exclusion in secondary recurrence
    tests:
    - not_null
  - name: uses_vidyard
    description: Indicates if Vidyard is used
    tests:
    - not_null
  - name: collections_hold
    description: Custom field for collections hold status
    tests:
    - not_null
  - name: execute_collections_plan
    description: Custom field for collections plan activity
    tests:
    - not_null
  - name: is_archived
    description: Indicates if the event is archived
    tests:
    - not_null
  - name: activity_date
    description: Date of the activity or event
    tests:
    - not_null
  - name: activity_datetime
    description: Date and time of the activity or event
    tests:
    - not_null
  - name: attendance_number
    description: Custom field for number of attendees
    tests:
    - not_null
  - name: call_disposition
    description: Outcome of Sales Loft call
    tests:
    - not_null
  - name: call_recording
    description: Custom field for call recording information
    tests:
    - not_null
  - name: call_sentiment
    description: Sentiment of Sales Loft call
    tests:
    - not_null
  - name: chorus_call_id
    description: Custom field for Chorus call ID
    tests:
    - not_null
  - name: click_count
    description: Number of clicks in Sales Loft
    tests:
    - not_null
  - name: clicked_count
    description: Count of clicks in Sales Loft
    tests:
    - not_null
  - name: created_date
    description: Date and time the record was created
    tests:
    - not_null
  - name: email_template_id
    description: ID of the Sales Loft email template
    tests:
    - not_null
  - name: end_date
    description: End date of the event
    tests:
    - not_null
  - name: end_datetime
    description: End date and time of the event
    tests:
    - not_null
  - name: expected_payment_date
    description: Custom field for expected payment date
    tests:
    - not_null
  - name: first_meeting_date
    description: Date of the first meeting if applicable
    tests:
    - not_null
  - name: invitee_id
    description: Unique identifier for the invitee
    tests:
    - not_null
  - name: is_first_meeting
    description: Indicates if this is the first meeting
    tests:
    - not_null
  - name: last_modified_date
    description: Date and time of last modification
    tests:
    - not_null
  - name: recurrence_day_of_month
    description: Day of month for recurrence
    tests:
    - not_null
  - name: recurrence_end_date
    description: End date for recurrence
    tests:
    - not_null
  - name: recurrence_instance
    description: Instance of recurrence
    tests:
    - not_null
  - name: recurrence_interval
    description: Interval between recurrences
    tests:
    - not_null
  - name: recurrence_month
    description: Month of year for recurrence
    tests:
    - not_null
  - name: recurrence_pattern_description
    description: Text description of recurrence pattern
    tests:
    - not_null
  - name: recurrence_pattern_version
    description: Version of recurrence pattern
    tests:
    - not_null
  - name: recurrence_start_date
    description: Start date of recurrence pattern
    tests:
    - not_null
  - name: recurrence_start_datetime
    description: Start date and time of recurrence
    tests:
    - not_null
  - name: recurrence_time_zone
    description: Time zone for recurrence pattern
    tests:
    - not_null
  - name: recurrence_time_zone_id
    description: Time zone identifier for recurrence
    tests:
    - not_null
  - name: recurrence_type
    description: Type of recurrence
    tests:
    - not_null
  - name: recurrence_weekdays
    description: Days of week for recurrence
    tests:
    - not_null
  - name: recurring_activity_id
    description: Identifier for recurring activity
    tests:
    - not_null
  - name: start_date_time
    description: Start date and time of the event
    tests:
    - not_null
  - name: system_modstamp
    description: System modification timestamp
    tests:
    - not_null
  tests: []
4. stg_sf_task_data
Table catalog prepared by Cocoon
version: 2
models:
- name: stg_sf_task_data
  description: The table is about tasks or activities in a CRM system. It includes
    details such as subject, description, status, priority, and dates. The table also
    contains information about task owners, related accounts, and contacts. There
    are fields for recurrence, reminders, and call-related data. Additional custom
    fields suggest integration with tools like SalesLoft and tracking of co-selling
    activities.
  columns:
  - name: related_person_id
    description: ID of the related 'who' object
    tests:
    - not_null
  - name: owner_id
    description: ID of the task owner
    tests:
    - not_null
  - name: subject
    description: Subject or title of the task
    tests:
    - not_null
  - name: description
    description: Detailed description of the task or activity
    tests:
    - not_null
  - name: is_recurring
    description: Indicates if the task is recurring
    tests:
    - not_null
  - name: related_object_count
    description: Number of related 'what' objects
    tests:
    - not_null
  - name: is_deleted
    description: Indicates if the task is deleted
    tests:
    - not_null
  - name: last_modified_by_id
    description: ID of the user who last modified
    tests:
    - not_null
  - name: id
    description: Unique identifier for the task
    tests:
    - not_null
    - unique
    cocoon_meta:
      unique_reason: This column represents a unique identifier for each task. For
        this table, each row is a distinct task or activity in the CRM system. The
        id appears to be unique across rows.
  - name: is_high_priority
    description: Indicates if the task is high priority
    tests:
    - not_null
  - name: is_closed
    description: Indicates if the task is closed
    tests:
    - not_null
  - name: has_reminder
    description: Indicates if a reminder is set
    tests:
    - not_null
  - name: priority
    description: Priority level of the task
    tests:
    - not_null
    - accepted_values:
        values:
        - Normal
    cocoon_meta:
      future_accepted_values:
      - Low
      - High
      - Urgent
      - Critical
  - name: related_person_count
    description: Number of related 'who' objects
    tests:
    - not_null
  - name: account_id
    description: Unique identifier for the associated account
    tests:
    - not_null
  - name: creator_id
    description: ID of the user who created the record
    tests:
    - not_null
  - name: related_object_id
    description: ID of the related 'what' object
    tests:
    - not_null
  - name: task_subtype
    description: Subtype or category of the task
    tests:
    - not_null
  - name: status
    description: Current status of the task
    tests:
    - not_null
    - accepted_values:
        values:
        - Completed
    cocoon_meta:
      future_accepted_values:
      - Not Started
      - In Progress
      - On Hold
      - Canceled
      - Deferred
      - Waiting for Input
      - Under Review
      - Approved
      - Rejected
  - name: is_no_show
    description: Indicates if it was a no-show
    tests:
    - not_null
  - name: record_type_id
    description: Unique identifier for the record type
    tests:
    - not_null
  - name: replies_count
    description: SalesLoft replies count
    tests:
    - not_null
  - name: has_vidyard_video
    description: Indicates if Vidyard video is associated
    tests:
    - not_null
  - name: is_collections_plan_activity
    description: Indicates if it's a collections plan activity
    tests:
    - not_null
  - name: is_collections_hold
    description: Indicates if collections are on hold
    tests:
    - not_null
  - name: meeting_type
    description: Type of the meeting
    tests:
    - not_null
    - accepted_values:
        values:
        - Default Personal Meeting
    cocoon_meta:
      future_accepted_values:
      - Team Meeting
      - One-on-One Meeting
      - Project Meeting
      - Client Meeting
      - Board Meeting
      - Staff Meeting
      - Training Session
      - Brainstorming Session
      - Conference Call
      - Video Conference
      - Workshop
      - Seminar
      - Interview
      - Performance Review
      - Strategy Meeting
      - Status Update Meeting
      - All-Hands Meeting
      - Department Meeting
      - Crisis Management Meeting
  - name: meeting_name
    description: Name of the meeting
    tests:
    - not_null
  - name: assignee_name
    description: Name of the person assigned to the task
    tests:
    - not_null
  - name: is_archived
    description: Indicates if the task is archived
    tests:
    - not_null
  - name: activity_date
    description: Date and time of the activity
    tests:
    - not_null
  - name: cadence_id
    description: SalesLoft cadence ID
    tests:
    - not_null
  - name: cadence_name
    description: SalesLoft cadence name
    tests:
    - not_null
  - name: cadence_name_alt
    description: SalesLoft cadence name
    tests:
    - not_null
  - name: call_duration_seconds
    description: Duration of the call in seconds
    tests:
    - not_null
  - name: call_object
    description: Object associated with the call
    tests:
    - not_null
  - name: call_recording
    description: Link or reference to call recording
    tests:
    - not_null
  - name: call_sentiment
    description: SalesLoft call sentiment
    tests:
    - not_null
  - name: call_type
    description: Type or category of the call
    tests:
    - not_null
  - name: chorus_call_id
    description: Custom field for Chorus call ID
    tests:
    - not_null
  - name: completion_datetime
    description: Date and time the task was completed
    tests:
    - not_null
  - name: creation_datetime
    description: Date and time the record was created
    tests:
    - not_null
  - name: email_template_id
    description: SalesLoft email template ID
    tests:
    - not_null
  - name: email_template_title
    description: SalesLoft email template title
    tests:
    - not_null
  - name: email_template_title_alt
    description: SalesLoft email template title
    tests:
    - not_null
  - name: last_modified_date
    description: Date of last modification
    tests:
    - not_null
  - name: last_modified_timestamp
    description: Last modification timestamp of the record
    tests:
    - not_null
  - name: recurrence_activity_id
    description: ID of the recurring activity
    tests:
    - not_null
  - name: recurrence_day_of_month
    description: Day of the month for recurrence
    tests:
    - not_null
  - name: recurrence_end_date
    description: End date for the recurrence
    tests:
    - not_null
  - name: recurrence_instance
    description: Instance of the recurrence
    tests:
    - not_null
  - name: recurrence_interval
    description: Interval between recurrences
    tests:
    - not_null
  - name: recurrence_month
    description: Month of the year for recurrence
    tests:
    - not_null
  - name: recurrence_regeneration_type
    description: Type of recurrence regeneration
    tests:
    - not_null
  - name: recurrence_start_date
    description: Start date for the recurrence
    tests:
    - not_null
  - name: recurrence_timezone
    description: Time zone for recurrence
    tests:
    - not_null
  - name: recurrence_type
    description: Type of recurrence
    tests:
    - not_null
  - name: recurrence_weekday_mask
    description: Mask for days of the week recurrence
    tests:
    - not_null
  - name: view_count
    description: SalesLoft view count
    tests:
    - not_null
  tests: []
5. stg_sf_product_2_data
Table catalog prepared by Cocoon
version: 2
models:
- name: stg_sf_product_2_data
  description: The table is about product data. It contains details like product code,
    name, description, and various flags. There are fields related to pricing, billing,
    subscriptions, and configuration. It includes Salesforce-specific fields, NetSuite
    integration fields, and custom fields. The table tracks product status, categorization,
    and metadata. It also has fields for tax, revenue recognition, and promotional
    information.
  columns:
  - name: is_active
    description: Flag indicating if the product is active
    tests:
    - not_null
  - name: record_type_id
    description: Identifier for the record type
    tests:
    - not_null
  - name: is_deleted
    description: Flag indicating if the product is deleted
    tests:
    - not_null
  - name: last_modified_by_id
    description: ID of user who last modified the product
    tests:
    - not_null
  - name: product_name
    description: Name of the product
    tests:
    - not_null
  - name: product_id
    description: Unique identifier for the product
    tests:
    - not_null
    - unique
    cocoon_meta:
      unique_reason: This column is the unique identifier for the product. For this
        table, each row represents a product. product_id is designed to be unique
        for each product, making it a perfect candidate key.
  - name: creator_id
    description: ID of user who created the record
    tests:
    - not_null
  - name: product_family
    description: Product family or category
    tests:
    - not_null
  - name: netsuite_sync_in_progress
    description: NetSuite sync in progress status
    tests:
    - not_null
  - name: netsuite_celigo_update
    description: NetSuite Celigo update status
    tests:
    - not_null
  - name: netsuite_sync_error
    description: NetSuite sync error status
    tests:
    - not_null
    - accepted_values:
        values:
        - X
    cocoon_meta:
      future_accepted_values:
      - Error
  - name: push_to_netsuite
    description: Flag to push product to NetSuite
    tests:
    - not_null
  - name: netsuite_item_type
    description: NetSuite item type
    tests:
    - not_null
    - accepted_values:
        values:
        - Non Inventory Sale
    cocoon_meta:
      future_accepted_values:
      - Inventory Item
      - Non Inventory Item
      - Service
      - Other Charge
      - Group
      - Kit
      - Assembly
      - Description
      - Discount
      - Markup
      - Payment
      - Subtotal
      - Gift Certificate
      - Download Item
  - name: netsuite_subtype
    description: NetSuite subtype for the product
    tests:
    - not_null
    - accepted_values:
        values:
        - noninventory-Sale
    cocoon_meta:
      future_accepted_values:
      - noninventory-Resale
      - inventory
      - assembly
      - kit
      - service
      - description
      - discount
      - markup
      - payment
      - subtotal
      - group
      - endgroup
  - name: is_new
    description: Custom field for new product status
    tests:
    - not_null
  - name: asset_amendment_behavior
    description: Behavior for asset amendments
    tests:
    - not_null
    - accepted_values:
        values:
        - Default
    cocoon_meta:
      future_accepted_values:
      - Ignore
      - Replace
      - Append
      - Merge
      - Version
      - Archive
      - Notify
      - Review
      - Approve
      - Reject
      - Audit
  - name: asset_conversion
    description: Asset conversion details
    tests:
    - not_null
  - name: billing_frequency
    description: Frequency of billing
    tests:
    - not_null
    - accepted_values:
        values:
        - Annual
    cocoon_meta:
      future_accepted_values:
      - Monthly
      - Quarterly
      - Semi-Annual
      - Weekly
      - Bi-Weekly
      - Daily
  - name: billing_type
    description: Type of billing
    tests:
    - not_null
    - accepted_values:
        values:
        - Advance
    cocoon_meta:
      future_accepted_values:
      - Arrears
      - Monthly
      - Quarterly
      - Annually
      - Pay-as-you-go
      - Usage-based
      - Subscription
      - One-time
      - Installment
  - name: block_pricing_field
    description: Field for block pricing
    tests:
    - not_null
  - name: charge_type
    description: Type of charge
    tests:
    - not_null
    - accepted_values:
        values:
        - Recurring
    cocoon_meta:
      future_accepted_values:
      - One-time
      - Subscription
      - Usage-based
      - Tiered
      - Per-unit
      - Flat rate
      - Variable
      - Prorated
      - Bundled
      - Add-on
      - Overage
      - Setup/Installation
      - Maintenance
      - Cancellation
      - Late payment
      - Refund
  - name: is_component
    description: Component information
    tests:
    - not_null
  - name: is_cost_editable
    description: Indicates if cost is editable
    tests:
    - not_null
  - name: is_custom_configuration_required
    description: Requires custom configuration
    tests:
    - not_null
  - name: is_description_locked
    description: Indicates if description is locked
    tests:
    - not_null
  - name: exclude_from_maintenance
    description: Excludes product from maintenance
    tests:
    - not_null
  - name: exclude_from_opportunity
    description: Excludes product from opportunity
    tests:
    - not_null
  - name: is_externally_configurable
    description: Indicates if externally configurable
    tests:
    - not_null
  - name: has_configuration_attributes
    description: Has configuration attributes
    tests:
    - not_null
  - name: has_consumption_schedule
    description: Has consumption schedule
    tests:
    - not_null
  - name: is_hidden
    description: Indicates if product is hidden
    tests:
    - not_null
  - name: hide_price_in_search_results
    description: Hides price in search results
    tests:
    - not_null
  - name: include_in_maintenance
    description: Includes product in maintenance
    tests:
    - not_null
  - name: create_new_quote_group
    description: Creates new quote group
    tests:
    - not_null
  - name: is_non_discountable
    description: Indicates if product is non-discountable
    tests:
    - not_null
  - name: is_non_partner_discountable
    description: Non-partner discountable product
    tests:
    - not_null
  - name: option_selection_method
    description: Method for selecting product options
    tests:
    - not_null
    - accepted_values:
        values:
        - Click
    cocoon_meta:
      future_accepted_values:
      - Dropdown
      - Radio button
      - Checkbox
      - Text input
      - Slider
      - Color picker
      - Date picker
      - Multi-select
      - Autocomplete
      - Drag and drop
      - Toggle switch
      - Image selection
      - Swatch
      - Button group
  - name: is_optional
    description: Indicates if the product is optional
    tests:
    - not_null
  - name: is_price_editable
    description: Allows price editing
    tests:
    - not_null
  - name: pricing_method
    description: Method used for product pricing
    tests:
    - not_null
    - accepted_values:
        values:
        - List
    cocoon_meta:
      future_accepted_values:
      - Cost-plus
      - Value-based
      - Competition-based
      - Dynamic
      - Penetration
      - Skimming
      - Bundle
      - Freemium
      - Subscription
      - Pay-what-you-want
      - Auction
      - Loss leader
      - Psychological
      - Geographic
      - Time-based
      - Premium
  - name: is_pricing_method_editable
    description: Allows editing of pricing method
    tests:
    - not_null
  - name: is_quantity_editable
    description: Allows quantity editing
    tests:
    - not_null
  - name: is_reconfiguration_disabled
    description: Disables product reconfiguration
    tests:
    - not_null
  - name: subscription_base
    description: Base for subscription pricing
    tests:
    - not_null
    - accepted_values:
        values:
        - List
    cocoon_meta:
      future_accepted_values:
      - Cost
      - Market
      - Tiered
      - Usage-based
      - Value-based
      - Freemium
      - Per user
      - Per feature
      - Flat rate
      - Pay-as-you-go
      - Subscription length
  - name: subscription_pricing_model
    description: Pricing model for subscriptions
    tests:
    - not_null
    - accepted_values:
        values:
        - Fixed Price
    cocoon_meta:
      future_accepted_values:
      - Usage-Based
      - Tiered Pricing
      - Per User
      - Freemium
      - Pay-As-You-Go
      - Flat Rate
      - Per Feature
      - Hybrid
  - name: subscription_term
    description: Term length for subscription
    tests:
    - not_null
  - name: subscription_type
    description: Type of subscription
    tests:
    - not_null
    - accepted_values:
        values:
        - Renewable
    cocoon_meta:
      future_accepted_values:
      - Non-renewable
      - Fixed rate
      - Variable rate
      - Time-of-use
      - Green energy
      - Solar
      - Wind
      - Hydro
      - Nuclear
      - Prepaid
      - Pay-as-you-go
      - Bundle
      - Commercial
      - Residential
      - Industrial
  - name: is_taxable
    description: Indicates if product is taxable
    tests:
    - not_null
  - name: connector_type
    description: Type of the product connector
    tests:
    - not_null
  - name: pro_type_discount
    description: Custom field for pro-type discount
    tests:
    - not_null
  - name: product_dimension
    description: Dimension of the product
    tests:
    - not_null
  - name: connector_status
    description: Status of the product connector
    tests:
    - not_null
    - accepted_values:
        values:
        - Alpha
        - General Availability
    cocoon_meta:
      future_accepted_values:
      - Beta
      - Release Candidate
      - Deprecated
      - End of Life
      - Maintenance
      - Limited Availability
      - Early Access
      - Preview
  - name: is_complimentary
    description: Custom field for complimentary product status
    tests:
    - not_null
  - name: external_product_id
    description: External identifier for the product
    tests:
    - not_null
  - name: billing_rule
    description: Billing rule for the product
    tests:
    - not_null
  - name: revenue_recognition_rule
    description: Revenue recognition rule for the product
    tests:
    - not_null
  - name: tax_rule
    description: Tax rule for the product
    tests:
    - not_null
  - name: no_prorate_flag
    description: Flag to prevent prorating
    tests:
    - not_null
  - name: enable_large_configuration
    description: Enables large configuration
    tests:
    - not_null
  - name: test_mode_flag
    description: Test mode flag for the record
    tests:
    - not_null
  - name: skip_netsuite_export
    description: Flag to skip NetSuite export
    tests:
    - not_null
  - name: is_non_recurring
    description: Custom field for non-recurring status
    tests:
    - not_null
  - name: is_archived
    description: Flag indicating if the product is archived
    tests:
    - not_null
  - name: celigo_last_modified_date
    description: Last modified date in Celigo integration
    tests:
    - not_null
  - name: creation_date
    description: Date when the record was created
    tests:
    - not_null
  - name: last_modified_date
    description: Date and time of last modification
    tests:
    - not_null
  - name: last_modified_timestamp
    description: Last modification timestamp of the record
    tests:
    - not_null
  - name: last_referenced_date
    description: Date and time the product was last referenced
    tests:
    - not_null
  - name: last_viewed_date
    description: Date and time the product was last viewed
    tests:
    - not_null
  - name: product_code
    description: Unique identifier code for the product
    tests:
    - not_null
    - unique
    cocoon_meta:
      unique_reason: This column represents a unique identifier code for the product.
        For this table, each row represents a unique product. product_code is likely
        to be unique across rows, as it's common practice to assign unique codes to
        products for identification purposes.
  - name: product_connections
    description: Connections associated with the product
    tests:
    - not_null
  - name: renewal_product
    description: Product used for renewals
    tests:
    - not_null
  - name: sbqq_default_quantity_c
    description: ''
    tests:
    - not_null
  tests: []
6. stg_sf_opportunity_line_item_data
Table catalog prepared by Cocoon
version: 2
models:
- name: stg_sf_opportunity_line_item_data
  description: The table is about opportunity line items. It contains details such
    as product ID, quantity, price, discount, and opportunity ID. Each record represents
    a specific product or service within a sales opportunity. The table includes various
    custom fields related to NetSuite integration, subscription types, and product
    families. It also has system fields for tracking creation, modification, and deletion
    of records.
  columns:
  - name: product_id
    description: Unique identifier for the product
    tests:
    - not_null
  - name: quantity
    description: Quantity of the product
    tests:
    - not_null
  - name: total_price
    description: Total price for the line item
    tests:
    - not_null
  - name: product_code
    description: Code identifying the product
    tests:
    - not_null
    - accepted_values:
        values:
        - a
        - b
        - d
        - e
        - f
        - l
        - m
        - n
        - p
        - s
    cocoon_meta:
      future_accepted_values:
      - c
      - g
      - h
      - i
      - j
      - k
      - o
      - q
      - r
      - t
      - u
      - v
      - w
      - x
      - y
      - z
  - name: unit_price
    description: Price per unit
    tests:
    - not_null
  - name: is_deleted
    description: Indicates if the record has been deleted
    tests:
    - not_null
  - name: opportunity_id
    description: Unique identifier for the opportunity
    tests:
    - not_null
  - name: last_modified_by_id
    description: ID of the user who last modified the record
    tests:
    - not_null
  - name: product_name
    description: Name of the product or service
    tests:
    - not_null
  - name: line_item_id
    description: Unique identifier for the opportunity line item
    tests:
    - not_null
    - unique
    cocoon_meta:
      unique_reason: This column represents a unique identifier for each opportunity
        line item. For this table, each row is for a specific line item in an opportunity.
        line_item_id appears to be unique across rows, as it's designed to uniquely
        identify each line item.
  - name: created_by_id
    description: ID of the user who created the record
    tests:
    - not_null
  - name: pricebook_entry_id
    description: Unique identifier for pricebook entry
    tests:
    - not_null
  - name: contract_duration_months
    description: Number of months for the contract or subscription
    tests:
    - not_null
  - name: pushed_from_netsuite
    description: Indicates if pushed from NetSuite
    tests:
    - not_null
  - name: sbqq_parent_id
    description: Parent ID for SBQQ
    tests:
    - not_null
  - name: sbqq_quote_line
    description: Quote line for SBQQ
    tests:
    - not_null
  - name: subscription_type
    description: Subscription type for SBQQ
    tests:
    - not_null
    - accepted_values:
        values:
        - Renewable
    cocoon_meta:
      future_accepted_values:
      - One-Time
      - Evergreen
      - Perpetual
      - Trial
      - Fixed-Term
      - Consumption-Based
      - Pay-As-You-Go
      - Subscription
  - name: product_family
    description: Product family classification
    tests:
    - not_null
  - name: hvr_use_case
    description: HVR use case for the line item
    tests:
    - not_null
  - name: created_date
    description: Date and time when the record was created
    tests:
    - not_null
  - name: is_fivetran_active
    description: Indicates if the record is active in Fivetran
    tests:
    - not_null
  - name: last_modified_date
    description: Date and time when the record was last modified
    tests:
    - not_null
  - name: list_price
    description: List price of the product or service
    tests:
    - not_null
  - name: system_modstamp
    description: System modification timestamp
    tests:
    - not_null
  tests: []
7. stg_sf_opportunity_history_data
Table catalog prepared by Cocoon
version: 2
models:
- name: stg_sf_opportunity_history_data
  description: The table is about sales opportunities. It includes details such as
    account ID, amount, close date, created date, forecast category, and stage name.
    The table also tracks if the opportunity is closed, won, or deleted. Additional
    information includes owner ID, probability, and lead source. Each opportunity
    has a unique ID and is associated with fiscal quarters and years.
  columns:
  - name: opportunity_amount
    description: Monetary value of the opportunity
    tests:
    - not_null
  - name: has_open_activity
    description: Indicates if there's an open activity
    tests:
    - not_null
  - name: lead_source
    description: Source of the lead for this opportunity
    tests:
    - not_null
  - name: opportunity_stage
    description: Current stage of the sales opportunity
    tests:
    - not_null
    - accepted_values:
        values:
        - GavUFuuf4DrnQAoiRGlWpQ==
        - tXi3M8u3iPxq0ggxTSxMKw==
        - 9RN9J3tlxr89gDctReax5w==
    cocoon_meta:
      future_accepted_values:
      - Prospecting
      - Qualification
      - Needs Analysis
      - Proposal
      - Negotiation
      - Closed Won
      - Closed Lost
  - name: is_active
    description: Indicates if the record is active in Fivetran
    tests:
    - not_null
  - name: is_won
    description: Indicates if the opportunity is won
    tests:
    - not_null
  - name: opportunity_id
    description: Unique identifier for the opportunity
    tests:
    - not_null
    - unique
    cocoon_meta:
      unique_reason: This column represents a unique identifier for each opportunity.
        For this table, each row represents a distinct sales opportunity, and the
        opportunity_id is designed to be unique across all opportunities.
  - name: opportunity_name
    description: Name of the opportunity
    tests:
    - not_null
  - name: account_id
    description: Unique identifier for the associated account
    tests:
    - not_null
  - name: fiscal_year
    description: Fiscal year of the opportunity
    tests:
    - not_null
  - name: forecast_category_id
    description: Category for forecasting purposes
    tests:
    - not_null
  - name: has_overdue_task
    description: Indicates if there's an overdue task
    tests:
    - not_null
  - name: has_line_items
    description: Indicates if opportunity has line items
    tests:
    - not_null
  - name: is_deleted
    description: Indicates if the opportunity is deleted
    tests:
    - not_null
  - name: win_probability
    description: Likelihood of winning the opportunity
    tests:
    - not_null
  - name: record_type_id
    description: Identifier for the type of sales record
    tests:
    - not_null
  - name: is_closed
    description: Indicates if the opportunity is closed
    tests:
    - not_null
  - name: fiscal_quarter
    description: Fiscal quarter of the opportunity
    tests:
    - not_null
  - name: owner_id
    description: Identifier for the opportunity owner
    tests:
    - not_null
  - name: campaign_id
    description: Identifier for associated marketing campaign
    tests:
    - not_null
  - name: close_date
    description: Date when the opportunity was closed
    tests:
    - not_null
  - name: created_date
    description: Date when the opportunity was created
    tests:
    - not_null
  - name: fivetran_sync_end
    description: End timestamp for Fivetran sync
    tests:
    - not_null
  - name: fivetran_sync_start
    description: Start timestamp for Fivetran sync
    tests:
    - not_null
  tests: []
8. stg_sf_opportunity_data
Table catalog prepared by Cocoon
version: 2
models:
- name: stg_sf_opportunity_data
  description: The table is about sales opportunities. It contains details like account
    ID, amount, close date, created date, forecast category, probability, and stage
    name. Each row represents a single opportunity with its associated information
    such as whether it's closed, won, or deleted. The table also includes fiscal period
    details and owner information for each opportunity.
  columns:
  - name: account_id
    description: Unique identifier for the associated account
    tests:
    - not_null
  - name: opportunity_amount
    description: Monetary value of the opportunity
    tests:
    - not_null
  - name: fiscal_quarter
    description: Fiscal quarter of the opportunity
    tests:
    - not_null
  - name: fiscal_year
    description: Fiscal year of the opportunity
    tests:
    - not_null
  - name: forecast_category_id
    description: Category for forecasting purposes
    tests:
    - not_null
  - name: has_open_activity
    description: Indicates if there are open activities
    tests:
    - not_null
  - name: has_line_items
    description: Indicates if opportunity has line items
    tests:
    - not_null
  - name: has_overdue_task
    description: Indicates if there are overdue tasks
    tests:
    - not_null
  - name: opportunity_id
    description: Unique identifier for the opportunity
    tests:
    - not_null
    - unique
    cocoon_meta:
      unique_reason: This column represents a unique identifier for each opportunity.
        For this table, each row is for a single opportunity, and opportunity_id is
        designed to be unique across rows.
  - name: is_closed
    description: Indicates if the opportunity is closed
    tests:
    - not_null
  - name: is_deleted
    description: Indicates if the opportunity is deleted
    tests:
    - not_null
  - name: is_won
    description: Indicates if the opportunity is won
    tests:
    - not_null
  - name: lead_source
    description: Source of the lead for this opportunity
    tests:
    - not_null
  - name: opportunity_name
    description: Name of the opportunity
    tests:
    - not_null
  - name: owner_id
    description: Identifier for the opportunity owner
    tests:
    - not_null
  - name: pricebook_id
    description: Identifier for the associated pricebook
    tests:
    - not_null
  - name: success_probability
    description: Likelihood of opportunity closing successfully
    tests:
    - not_null
  - name: record_type_id
    description: Identifier for the record type
    tests:
    - not_null
  - name: stage_name
    description: Name of the sales opportunity stage
    tests:
    - not_null
    - accepted_values:
        values:
        - GavUFuuf4DrnQAoiRGlWpQ==
        - tXi3M8u3iPxq0ggxTSxMKw==
        - 9RN9J3tlxr89gDctReax5w==
    cocoon_meta:
      future_accepted_values:
      - Prospecting
      - Qualification
      - Needs Analysis
      - Value Proposition
      - Proposal
      - Negotiation
      - Closed Won
      - Closed Lost
  - name: is_active
    description: Indicates if the record is active in Fivetran
    tests:
    - not_null
  - name: close_date
    description: Date when the opportunity was closed
    tests:
    - not_null
  - name: created_date
    description: Date when the opportunity was created
    tests:
    - not_null
  - name: synced_quote_id
    description: ID of the synchronized quote, if any
    tests:
    - not_null
  tests: []
9. stg_sf_lead_data
Table catalog prepared by Cocoon
version: 2
models:
- name: stg_sf_lead_data
  description: The table is about sales leads. It contains detailed information on
    each lead, including personal data, contact information, lead source, conversion
    status, and various tracking and scoring metrics. The table also includes custom
    fields for specific business processes, marketing campaign data, and integration
    with third-party tools and services. It represents a comprehensive view of a lead's
    journey through the sales pipeline.
  columns:
  - name: owner_id
    description: ID of the lead owner
    tests:
    - not_null
  - name: last_modified_by_id
    description: ID of user who last modified the lead
    tests:
    - not_null
  - name: converted_contact_id
    description: ID of the contact after lead conversion
    tests:
    - not_null
  - name: id
    description: ''
    tests:
    - not_null
  - name: photo_url
    description: URL of the lead's photo
    tests:
    - not_null
  - name: longitude
    description: Geographical longitude of the lead's location
    tests:
    - not_null
  - name: name
    description: Name of the lead
    tests:
    - not_null
  - name: created_by_id
    description: ID of the user who created the lead
    tests:
    - not_null
  - name: is_converted
    description: Indicates if the lead has been converted
    tests:
    - not_null
  - name: is_unread_by_owner
    description: Indicates if the lead is unread by owner
    tests:
    - not_null
  - name: status
    description: Current status of the lead
    tests:
    - not_null
  - name: lead_latitude
    description: Latitude of the lead's location
    tests:
    - not_null
  - name: lead_industry
    description: Industry of the lead
    tests:
    - not_null
  - name: is_deleted
    description: Indicates if the lead has been deleted
    tests:
    - not_null
  - name: company_name
    description: Company name of the lead
    tests:
    - not_null
  - name: first_name
    description: First name of the lead
    tests:
    - not_null
  - name: email
    description: Lead's email address
    tests:
    - not_null
  - name: lead_last_name
    description: Last name of the lead
    tests:
    - not_null
  - name: active_in_sequence
    description: Indicates if lead is active in a sequence
    tests:
    - not_null
  - name: clearbit_data_ready
    description: Indicates if Clearbit data is ready
    tests:
    - not_null
  - name: has_opted_out_of_email
    description: ''
    tests:
    - not_null
  - name: converted_account_id
    description: ID of the account after lead conversion
    tests:
    - not_null
  - name: demo_scheduled_calendly
    description: Demo scheduled using Calendly
    tests:
    - not_null
  - name: marked_for_deletion
    description: Flag indicating if the lead should be deleted
    tests:
    - not_null
  - name: email_quality
    description: Email quality indicator
    tests:
    - not_null
  - name: email_bounced_c
    description: ''
    tests:
    - not_null
  - name: created_by_clearbit
    description: Indicates if created by Clearbit
    tests:
    - not_null
  - name: pi_score_c
    description: ''
    tests:
    - not_null
  - name: is_competitor
    description: Indicates if company is a competitor
    tests:
    - not_null
  - name: routing_action
    description: Routing action taken in LeanData
    tests:
    - not_null
  - name: search_index
    description: Search index in LeanData
    tests:
    - not_null
  - name: reporting_matched_account_id
    description: Matched account ID for reporting in LeanData
    tests:
    - not_null
  - name: routing_status
    description: Current routing status in LeanData
    tests:
    - not_null
  - name: do_not_route_lead
    description: Flag to prevent lead routing
    tests:
    - not_null
  - name: contact_stage
    description: Current stage of the contact in sales process
    tests:
    - not_null
  - name: intent_score
    description: Aggregate intent score of the lead
    tests:
    - not_null
  - name: fit_score
    description: Overall fit score for the lead
    tests:
    - not_null
  - name: prospect_routing_rules
    description: Prospect routing rules for marketing
    tests:
    - not_null
  - name: email_explicit_opt_in
    description: Explicit email opt-in status
    tests:
    - not_null
  - name: email_implicit_opt_in
    description: Implicit email opt-in status
    tests:
    - not_null
  - name: gdpr_opt_in_status
    description: Explicit GDPR opt-in status
    tests:
    - not_null
  - name: is_user_gem
    description: Indicates if the lead is a user gem
    tests:
    - not_null
  - name: last_interaction_description
    description: Last interesting moment description
    tests:
    - not_null
  - name: last_interaction_source
    description: Source of last interesting moment
    tests:
    - not_null
  - name: last_interaction_type
    description: Type of last interesting moment
    tests:
    - not_null
  - name: lead_priority_score
    description: Lead priority score
    tests:
    - not_null
  - name: lead_urgency
    description: Urgency value of the lead
    tests:
    - not_null
  - name: cloudingo_agent_as
    description: Cloudingo agent AS field
    tests:
    - not_null
  - name: cloudingo_agent_les
    description: Cloudingo agent LES field
    tests:
    - not_null
  - name: marketo_sync_exclusion
    description: Flag to exclude lead from Marketo sync
    tests:
    - not_null
  - name: last_utm_campaign
    description: Most recent UTM campaign
    tests:
    - not_null
  - name: last_utm_content
    description: Most recent UTM content
    tests:
    - not_null
  - name: last_utm_medium
    description: Most recent UTM medium
    tests:
    - not_null
  - name: last_utm_source
    description: Most recent UTM source
    tests:
    - not_null
  - name: last_utm_term
    description: Most recent UTM term
    tests:
    - not_null
  - name: behavioral_score
    description: Behavioral score of the lead
    tests:
    - not_null
  - name: is_emea_event_routing
    description: EMEA event routing status
    tests:
    - not_null
  - name: csi_description
    description: Description of the CSI code
    tests:
    - not_null
  - name: attended_event
    description: Indicates if lead attended an event
    tests:
    - not_null
  - name: manual_route_trigger
    description: Flag for manual routing trigger in LeanData
    tests:
    - not_null
  - name: mql_reason
    description: Reason for Marketing Qualified Lead status
    tests:
    - not_null
  - name: enrichment_request
    description: Flag for data enrichment request
    tests:
    - not_null
  - name: fivetran_use_case
    description: Potential use case for Fivetran
    tests:
    - not_null
  - name: sales_email_opt_out_c
    description: ''
    tests:
    - not_null
  - name: bombora_composite_score
    description: Total composite score from Bombora
    tests:
    - not_null
  - name: created_by_user_gems
    description: Indicates if created by User Gems
    tests:
    - not_null
  - name: is_verified
    description: Indicates if the lead is verified
    tests:
    - not_null
  - name: startup_certification_eligible
    description: Startup certification eligibility
    tests:
    - not_null
  - name: engagio_intent_minutes_30d
    description: Engagio intent minutes in last 30 days
    tests:
    - not_null
  - name: engagio_engagement_minutes_7d
    description: Engagio engagement minutes in last 7 days
    tests:
    - not_null
  - name: email_double_opt_in
    description: Double opt-in confirmation status
    tests:
    - not_null
  - name: account_all_data_warehouses
    description: List of all data warehouses used by account
    tests:
    - not_null
  - name: account_bi_tools
    description: Business intelligence tools used by the account
    tests:
    - not_null
  - name: account_connectors
    description: List of all connectors used by the account
    tests:
    - not_null
  - name: account_data_warehouses
    description: Data warehouses used by the account
    tests:
    - not_null
  - name: account_id
    description: Unique identifier for the account
    tests:
    - not_null
  - name: account_products
    description: List of all products associated with the account
    tests:
    - not_null
  - name: acquisition_date
    description: Date when the lead was acquired
    tests:
    - not_null
  - name: acquisition_program
    description: Acquisition program for the lead
    tests:
    - not_null
  - name: acquisition_program_id
    description: ID of the program that acquired the lead
    tests:
    - not_null
  - name: act_on_lead_score
    description: Lead score for Act-On marketing automation
    tests:
    - not_null
  - name: actoncity_c
    description: ''
    tests:
    - not_null
  - name: actoncountry_c
    description: ''
    tests:
    - not_null
  - name: actoncountrycode_c
    description: ''
    tests:
    - not_null
  - name: actonpostalcode_c
    description: ''
    tests:
    - not_null
  - name: actonstate_c
    description: ''
    tests:
    - not_null
  - name: ad_group_id
    description: Advertising group ID for the lead
    tests:
    - not_null
  - name: alexa_rank
    description: Alexa rank from enrichment service
    tests:
    - not_null
  - name: all_lead_source_categories
    description: Categories of all lead sources
    tests:
    - not_null
  - name: all_lead_source_details
    description: Details of all lead sources
    tests:
    - not_null
  - name: all_lead_sources
    description: All lead sources for the contact
    tests:
    - not_null
  - name: all_utm_campaigns
    description: All UTM campaign tags
    tests:
    - not_null
  - name: all_utm_content
    description: All UTM content tags
    tests:
    - not_null
  - name: all_utm_ids
    description: All UTM ID tags
    tests:
    - not_null
  - name: all_utm_mediums
    description: All UTM medium tags
    tests:
    - not_null
  - name: all_utm_sources
    description: All UTM source tags
    tests:
    - not_null
  - name: all_utm_terms
    description: All UTM term tags
    tests:
    - not_null
  - name: allbound_id
    description: Unique identifier for Allbound integration
    tests:
    - not_null
  - name: annual_revenue
    description: Annual revenue of the account
    tests:
    - not_null
  - name: audience_names
    description: Audience names from enrichment service
    tests:
    - not_null
  - name: automation_tracking
    description: Automation tracking information for the lead
    tests:
    - not_null
  - name: beta_connector_interest
    description: Interest in beta connectors
    tests:
    - not_null
  - name: bizible_account_id
    description: Bizible 2 account identifier
    tests:
    - not_null
  - name: bizible_first_touch_campaign
    description: Bizible 2 ad campaign name (first touch)
    tests:
    - not_null
  - name: bizible_first_touch_landing_page
    description: Bizible 2 landing page (first touch)
    tests:
    - not_null
  - name: bizible_first_touch_marketing_channel
    description: Bizible 2 marketing channel (first touch)
    tests:
    - not_null
  - name: bizible_id
    description: Unique identifier for Bizible 2
    tests:
    - not_null
  - name: bizible_last_touch_campaign
    description: Bizible 2 ad campaign name (last touch)
    tests:
    - not_null
  - name: bizible_last_touch_landing_page
    description: Bizible 2 landing page (last touch)
    tests:
    - not_null
  - name: bombora_last_updated
    description: Last update timestamp from Bombora
    tests:
    - not_null
  - name: bombora_surge_count
    description: Number of surge records from Bombora
    tests:
    - not_null
  - name: bounced_email_c
    description: ''
    tests:
    - not_null
  - name: cadence_trigger
    description: Trigger for SalesLoft cadence
    tests:
    - not_null
  - name: calendly_created_date
    description: Date created in Calendly
    tests:
    - not_null
  - name: campaignid_c
    description: ''
    tests:
    - not_null
  - name: city
    description: City of the lead
    tests:
    - not_null
  - name: clarus_date
    description: Date related to Clarus project
    tests:
    - not_null
  - name: clarus_editor
    description: Editor of Clarus project
    tests:
    - not_null
  - name: clarus_notes
    description: Notes for Clarus project
    tests:
    - not_null
  - name: clarus_project_id
    description: Clarus project identifier
    tests:
    - not_null
  - name: clarus_status
    description: Status of Clarus project
    tests:
    - not_null
  - name: clearbit_status
    description: Clearbit data status
    tests:
    - not_null
  - name: cloudingo_agent_ar
    description: Cloudingo agent AR field
    tests:
    - not_null
  - name: cloudingo_agent_ardi
    description: Cloudingo agent ARDI field
    tests:
    - not_null
  - name: cloudingo_agent_atz
    description: Cloudingo agent ATZ field
    tests:
    - not_null
  - name: cloudingo_agent_av
    description: Cloudingo agent AV field
    tests:
    - not_null
  - name: company_phone
    description: Company phone number
    tests:
    - not_null
  - name: company_revenue
    description: Revenue of the lead's company
    tests:
    - not_null
  - name: company_type
    description: Type of company
    tests:
    - not_null
  - name: competitors
    description: List of competitors related to the lead
    tests:
    - not_null
  - name: connector_products
    description: Connector products associated with the lead
    tests:
    - not_null
  - name: contact_owner_override
    description: Contact owner override flag in LeanData
    tests:
    - not_null
  - name: contact_status
    description: Current status of the contact
    tests:
    - not_null
  - name: conversion_date
    description: Date when the lead converted
    tests:
    - not_null
  - name: conversion_object_name
    description: Name of the object after conversion
    tests:
    - not_null
  - name: conversion_object_type
    description: Type of object after conversion
    tests:
    - not_null
  - name: converted_date
    description: Date when the lead was converted
    tests:
    - not_null
  - name: converted_datetime
    description: Date and time of lead conversion
    tests:
    - not_null
  - name: converted_opportunity_id
    description: ID of the opportunity after lead conversion
    tests:
    - not_null
  - name: country
    description: Country of the lead
    tests:
    - not_null
  - name: country_code
    description: Country code of the lead
    tests:
    - not_null
  - name: country_custom
    description: Custom field for country information
    tests:
    - not_null
  - name: created_date
    description: Date when the lead was created
    tests:
    - not_null
  - name: created_timestamp
    description: Timestamp when the lead was created
    tests:
    - not_null
  - name: creative_content
    description: Creative content associated with the lead
    tests:
    - not_null
  - name: csi_code
    description: CSI code for the lead
    tests:
    - not_null
  - name: current_user_gems_info
    description: Current information from User Gems
    tests:
    - not_null
  - name: custom_city
    description: Custom field for city
    tests:
    - not_null
  - name: data_warehouse_products
    description: Data warehouse products associated with the lead
    tests:
    - not_null
  - name: data_warehouse_used
    description: Whether data warehouse is used
    tests:
    - not_null
  - name: demographic_score
    description: Demographic score of the lead
    tests:
    - not_null
  - name: description
    description: General description of the lead
    tests:
    - not_null
  - name: device
    description: Device associated with the lead
    tests:
    - not_null
  - name: direct_office
    description: Direct office information
    tests:
    - not_null
  - name: district
    description: Custom field for district information
    tests:
    - not_null
  - name: dnb_company_record
    description: D&B Optimizer company record
    tests:
    - not_null
  - name: dnb_contact_record
    description: D&B Optimizer contact record
    tests:
    - not_null
  - name: domain_exists
    description: Whether contact's domain exists
    tests:
    - not_null
  - name: drift_cql_status
    description: Drift Conversation Qualified Lead status
    tests:
    - not_null
  - name: duns_number
    description: D&B D-U-N-S Number
    tests:
    - not_null
  - name: email_bounce_date
    description: Date when email bounced
    tests:
    - not_null
  - name: email_bounce_reason
    description: Reason for email bounce
    tests:
    - not_null
  - name: email_catchall
    description: Catchall email quality flag
    tests:
    - not_null
  - name: email_opt_in
    description: General email opt-in status
    tests:
    - not_null
  - name: email_opt_out_date_time_c
    description: ''
    tests:
    - not_null
  - name: employee_range
    description: Employee range category from LeadIQ
    tests:
    - not_null
  - name: engagio_department
    description: Department identified by Engagio
    tests:
    - not_null
  - name: engagio_engagement_minutes_3m
    description: Engagio engagement minutes in last 3 months
    tests:
    - not_null
  - name: engagio_first_engagement_date
    description: Date of first engagement in Engagio
    tests:
    - not_null
  - name: engagio_match_time
    description: Time of Engagio account match
    tests:
    - not_null
  - name: engagio_matched_account
    description: Matched account in Engagio
    tests:
    - not_null
  - name: engagio_role
    description: Role identified by Engagio
    tests:
    - not_null
  - name: enriched_city
    description: City from enrichment service
    tests:
    - not_null
  - name: enriched_timestamp
    description: Timestamp of lead data enrichment
    tests:
    - not_null
  - name: es_app_escountry_c
    description: ''
    tests:
    - not_null
  - name: es_app_esecid_c
    description: ''
    tests:
    - not_null
  - name: es_app_esemployees_c
    description: ''
    tests:
    - not_null
  - name: es_app_eslinked_in_c
    description: ''
    tests:
    - not_null
  - name: es_app_essource_c
    description: ''
    tests:
    - not_null
  - name: es_app_esstate_c
    description: ''
    tests:
    - not_null
  - name: facebook_url
    description: Facebook profile URL of the lead
    tests:
    - not_null
  - name: fax
    description: Fax number of the lead
    tests:
    - not_null
  - name: feature_requests
    description: Feature requests made by the lead
    tests:
    - not_null
  - name: first_activity
    description: First recorded activity of the lead
    tests:
    - not_null
  - name: first_lead_source
    description: First lead source for the contact
    tests:
    - not_null
  - name: first_lead_source_category
    description: Category of the first lead source
    tests:
    - not_null
  - name: first_lead_source_detail
    description: Details of the first lead source
    tests:
    - not_null
  - name: first_mql_date
    description: Date of first Marketing Qualified Lead status
    tests:
    - not_null
  - name: first_search_term
    description: First search term used by the lead
    tests:
    - not_null
  - name: first_search_type
    description: Type of first search performed
    tests:
    - not_null
  - name: first_touch_url
    description: URL of the first interaction
    tests:
    - not_null
  - name: first_touchpoint_date
    description: First touch date of the lead
    tests:
    - not_null
  - name: first_touchpoint_source
    description: First touch source of the lead
    tests:
    - not_null
  - name: first_utm_campaign
    description: First UTM campaign tag
    tests:
    - not_null
  - name: first_utm_content
    description: First UTM content tag
    tests:
    - not_null
  - name: first_utm_id
    description: First UTM ID tag
    tests:
    - not_null
  - name: first_utm_medium
    description: First UTM medium used by the lead
    tests:
    - not_null
  - name: first_utm_source
    description: First UTM source used by the lead
    tests:
    - not_null
  - name: first_utm_term
    description: First UTM term used by the lead
    tests:
    - not_null
  - name: fivetran_account_id
    description: Fivetran account ID
    tests:
    - not_null
  - name: fivetran_account_stage
    description: Stage of the Fivetran account
    tests:
    - not_null
  - name: fivetran_active_status
    description: Indicates if the record is active in Fivetran
    tests:
    - not_null
  - name: fivetran_association_date
    description: Date of Fivetran account association
    tests:
    - not_null
  - name: fivetran_user_id
    description: Fivetran user identifier
    tests:
    - not_null
  - name: fivetran_user_roles
    description: User roles in Fivetran account
    tests:
    - not_null
  - name: free_trial_confirmation_date
    description: Date when free trial email was confirmed
    tests:
    - not_null
  - name: geo_city_c
    description: ''
    tests:
    - not_null
  - name: geo_country_c
    description: ''
    tests:
    - not_null
  - name: geo_country_code_c
    description: ''
    tests:
    - not_null
  - name: geo_postal_code_c
    description: ''
    tests:
    - not_null
  - name: geo_state_c
    description: ''
    tests:
    - not_null
  - name: geocode_accuracy
    description: Accuracy of geocoding for lead's location
    tests:
    - not_null
  - name: google_click_id
    description: Google Click ID for tracking ad clicks
    tests:
    - not_null
  - name: has_changed_job
    description: Indicates if the lead has changed jobs
    tests:
    - not_null
  - name: hvr_channel
    description: HVR channel information
    tests:
    - not_null
  - name: i_sell_os_key_id
    description: I Sell OS key identifier
    tests:
    - not_null
  - name: individual_id
    description: Unique identifier for the individual
    tests:
    - not_null
  - name: industry
    description: Industry of the lead's company
    tests:
    - not_null
  - name: inferred_city
    description: Inferred city of the lead
    tests:
    - not_null
  - name: inferred_company
    description: Inferred company of the lead
    tests:
    - not_null
  - name: inferred_country
    description: Inferred country of the lead
    tests:
    - not_null
  - name: inferred_metro_area
    description: Inferred metropolitan area of the lead
    tests:
    - not_null
  - name: inferred_phone_area_code
    description: Inferred phone area code of the lead
    tests:
    - not_null
  - name: inferred_postal_code
    description: Inferred postal code of the lead
    tests:
    - not_null
  - name: inferred_state_region
    description: Inferred state or region of the lead
    tests:
    - not_null
  - name: intent_timestamp
    description: Timestamp of last intent score update
    tests:
    - not_null
  - name: intent_topics
    description: Topics of interest for the lead
    tests:
    - not_null
  - name: is_enriched
    description: Flag indicating if lead data was enriched
    tests:
    - not_null
  - name: is_previous_customer
    description: Indicates if lead was a previous customer
    tests:
    - not_null
  - name: is_startup
    description: Indicates if lead is a startup
    tests:
    - not_null
  - name: jigsaw_contact_id
    description: Jigsaw contact identifier
    tests:
    - not_null
  - name: job_title
    description: Job title of the lead
    tests:
    - not_null
  - name: keywords
    description: Keywords associated with the lead
    tests:
    - not_null
  - name: last_activity
    description: Most recent activity of the lead
    tests:
    - not_null
  - name: last_activity_date
    description: Date of last activity for the lead
    tests:
    - not_null
  - name: last_completed_cadence_step
    description: Last completed step in SalesLoft cadence
    tests:
    - not_null
  - name: last_interesting_moment_date
    description: Date of last interesting moment in Sales Insight
    tests:
    - not_null
  - name: last_lead_source
    description: Most recent lead source
    tests:
    - not_null
  - name: last_lead_source_category
    description: Category of the most recent lead source
    tests:
    - not_null
  - name: last_lead_source_detail
    description: Detailed information about the most recent lead source
    tests:
    - not_null
  - name: last_modified_date
    description: Date when the lead was last modified
    tests:
    - not_null
  - name: last_modified_timestamp
    description: Last modification timestamp
    tests:
    - not_null
  - name: last_referenced_date
    description: Date when the lead was last referenced
    tests:
    - not_null
  - name: last_touchpoint_date
    description: Last touch date of the lead
    tests:
    - not_null
  - name: last_touchpoint_source
    description: Last touch source of the lead
    tests:
    - not_null
  - name: last_utm_id
    description: Most recent UTM ID
    tests:
    - not_null
  - name: last_viewed_date
    description: Date when the lead was last viewed
    tests:
    - not_null
  - name: lead_bi_tools
    description: Business intelligence tools used by lead
    tests:
    - not_null
  - name: lead_comments
    description: Comments related to the lead
    tests:
    - not_null
  - name: lead_creation_date
    description: Date when the lead was created
    tests:
    - not_null
  - name: lead_creation_datetime
    description: Date and time when the lead was created
    tests:
    - not_null
  - name: lead_grade
    description: Grade assigned to the lead
    tests:
    - not_null
  - name: lead_iq_country_c
    description: ''
    tests:
    - not_null
  - name: lead_iq_employee_count_c
    description: ''
    tests:
    - not_null
  - name: lead_iq_state_c
    description: ''
    tests:
    - not_null
  - name: lead_keyword
    description: Keyword associated with the lead
    tests:
    - not_null
  - name: lead_notes
    description: Additional notes about the lead
    tests:
    - not_null
  - name: lead_number_c
    description: ''
    tests:
    - not_null
  - name: lead_referrer
    description: Referrer source in Act-On
    tests:
    - not_null
  - name: lead_source
    description: Source of the lead
    tests:
    - not_null
  - name: lead_source_details
    description: Detailed information about the lead source
    tests:
    - not_null
  - name: lead_state_acton
    description: State of the lead's location (Acton-specific)
    tests:
    - not_null
  - name: lead_tags
    description: Tags associated with lead in LeanData
    tests:
    - not_null
  - name: lead_type
    description: Classification or category of the lead
    tests:
    - not_null
  - name: lead_url
    description: URL associated with the lead
    tests:
    - not_null
  - name: lead_zip_code
    description: ZIP code of the lead from LeadIQ
    tests:
    - not_null
  - name: leandata_account
    description: Account associated with lead in LeanData
    tests:
    - not_null
  - name: leandata_group
    description: Group associated with lead in LeanData
    tests:
    - not_null
  - name: leandata_segment
    description: Segment associated with lead in LeanData
    tests:
    - not_null
  - name: legacy_id
    description: Legacy identifier for the lead
    tests:
    - not_null
  - name: linked_in_url_c
    description: ''
    tests:
    - not_null
  - name: linkedin_company_id
    description: LinkedIn company ID associated with the lead
    tests:
    - not_null
  - name: linkedin_member_token
    description: LinkedIn member token for the lead
    tests:
    - not_null
  - name: linkedin_profile
    description: LinkedIn profile information
    tests:
    - not_null
  - name: marketing_channel
    description: Marketing channel for the lead
    tests:
    - not_null
  - name: marketing_cloud_subscriber
    description: Marketing Cloud subscriber status
    tests:
    - not_null
  - name: marketing_connector_interest
    description: Interest level in marketing connector
    tests:
    - not_null
  - name: marketing_process_stage
    description: Current stage in the marketing process
    tests:
    - not_null
  - name: marketing_system_creation_date
    description: Creation date in marketing system via LeanData
    tests:
    - not_null
  - name: marketo_contact_id
    description: Marketo Sales Insight contact ID
    tests:
    - not_null
  - name: marketo_sync_exclusion_reason
    description: Reason for not syncing with Marketo
    tests:
    - not_null
  - name: master_record_id
    description: Unique identifier for the master record
    tests:
    - not_null
  - name: match_type
    description: Type of match for the lead
    tests:
    - not_null
  - name: matched_account
    description: Matched account in LeanData
    tests:
    - not_null
  - name: matched_buyer_persona
    description: Matched buyer persona in LeanData
    tests:
    - not_null
  - name: matched_lead
    description: Matched lead in LeanData
    tests:
    - not_null
  - name: metadata_creation_date
    description: Date when the lead metadata was created
    tests:
    - not_null
  - name: mkto_71_lead_score_c
    description: ''
    tests:
    - not_null
  - name: mobile_phone
    description: Mobile phone number
    tests:
    - not_null
  - name: modified_score
    description: Modified score in LeanData
    tests:
    - not_null
  - name: mql_date
    description: Date lead became Marketing Qualified
    tests:
    - not_null
  - name: needs_score_sync
    description: Indicates if score needs syncing
    tests:
    - not_null
  - name: network
    description: Network or connection information
    tests:
    - not_null
  - name: next_cadence_step_due_date
    description: Due date for next SalesLoft cadence step
    tests:
    - not_null
  - name: notes
    description: Additional notes about the lead
    tests:
    - not_null
  - name: number_of_employees
    description: ''
    tests:
    - not_null
  - name: opportunity_competitors
    description: Competitors for the opportunity
    tests:
    - not_null
  - name: opportunity_products
    description: Products associated with the opportunity
    tests:
    - not_null
  - name: original_referrer
    description: Original referrer of the lead
    tests:
    - not_null
  - name: original_search_engine
    description: Original search engine used by the lead
    tests:
    - not_null
  - name: original_search_phrase
    description: Original search phrase used by the lead
    tests:
    - not_null
  - name: original_source_info
    description: Original source information of the lead
    tests:
    - not_null
  - name: original_source_type
    description: Original source type of the lead
    tests:
    - not_null
  - name: original_utm_campaign_c
    description: ''
    tests:
    - not_null
  - name: original_utm_content_c
    description: ''
    tests:
    - not_null
  - name: original_utm_medium_c
    description: ''
    tests:
    - not_null
  - name: original_utm_source_c
    description: ''
    tests:
    - not_null
  - name: original_utm_term_c
    description: ''
    tests:
    - not_null
  - name: pardot_hard_bounced
    description: Indicates if Pardot email hard bounced
    tests:
    - not_null
  - name: pardot_last_scored_at
    description: Last time lead was scored in Pardot
    tests:
    - not_null
  - name: partner_rep_email
    description: Email of partner representative
    tests:
    - not_null
  - name: partner_rep_name
    description: Name of partner representative
    tests:
    - not_null
  - name: partner_type
    description: Type of partnership
    tests:
    - not_null
  - name: past_account
    description: Past account information
    tests:
    - not_null
  - name: past_user_gems_info
    description: Past information from User Gems
    tests:
    - not_null
  - name: phone
    description: Phone number
    tests:
    - not_null
  - name: phone_number_catch_all
    description: Catch-all field for phone numbers
    tests:
    - not_null
  - name: pi_campaign_c
    description: ''
    tests:
    - not_null
  - name: pi_utm_campaign_c
    description: ''
    tests:
    - not_null
  - name: pi_utm_content_c
    description: ''
    tests:
    - not_null
  - name: pi_utm_medium_c
    description: ''
    tests:
    - not_null
  - name: pi_utm_source_c
    description: ''
    tests:
    - not_null
  - name: pi_utm_term_c
    description: ''
    tests:
    - not_null
  - name: postal_code
    description: Postal code of the lead
    tests:
    - not_null
  - name: previous_company
    description: Previous company of the lead
    tests:
    - not_null
  - name: previous_contact_info
    description: Previous contact information of the lead
    tests:
    - not_null
  - name: previous_job_title
    description: Previous job title of the lead
    tests:
    - not_null
  - name: previous_lead_source
    description: Previous lead source
    tests:
    - not_null
  - name: previous_lead_source_detail
    description: Details of previous lead source
    tests:
    - not_null
  - name: primary_contact
    description: Primary contact information
    tests:
    - not_null
  - name: promotion_id
    description: Identifier for associated promotion
    tests:
    - not_null
  - name: recent_cadence_name
    description: Most recent SalesLoft cadence name
    tests:
    - not_null
  - name: recent_campaign_status
    description: Status of recent marketing campaign
    tests:
    - not_null
  - name: referral_account
    description: Referral account information
    tests:
    - not_null
  - name: referral_contact
    description: Referral contact information
    tests:
    - not_null
  - name: referral_email
    description: Email address of the referral contact
    tests:
    - not_null
  - name: referral_first_name
    description: First name of the referral
    tests:
    - not_null
  - name: referral_last_name
    description: Last name of the referral
    tests:
    - not_null
  - name: region_c
    description: ''
    tests:
    - not_null
  - name: relative_score
    description: Relative score value
    tests:
    - not_null
  - name: reporting_timestamp
    description: Timestamp for reporting in LeanData
    tests:
    - not_null
  - name: reroute_flag
    description: Flag for re-routing in LeanData
    tests:
    - not_null
  - name: router_status
    description: Routing status in LeanData
    tests:
    - not_null
  - name: sales_email_opt_out_date_time_c
    description: ''
    tests:
    - not_null
  - name: sales_insight_hide_date
    description: Date to hide the lead in Sales Insight
    tests:
    - not_null
  - name: sales_volume_millions
    description: Sales volume in millions
    tests:
    - not_null
  - name: salutation
    description: Formal greeting or title
    tests:
    - not_null
  - name: search_terms
    description: Search terms used in LeanData
    tests:
    - not_null
  - name: secondary_email
    description: Alternative email address
    tests:
    - not_null
  - name: source_detail
    description: Detailed information about lead source
    tests:
    - not_null
  - name: state
    description: State or province of the lead
    tests:
    - not_null
  - name: state_code
    description: State code or abbreviation
    tests:
    - not_null
  - name: state_custom
    description: Custom field for state information
    tests:
    - not_null
  - name: status_info
    description: Additional status information in LeanData
    tests:
    - not_null
  - name: street
    description: Street address of the lead
    tests:
    - not_null
  - name: street_address
    description: Street address of the lead
    tests:
    - not_null
  - name: technologies
    description: Technologies used by the lead's company
    tests:
    - not_null
  - name: territory
    description: Custom field for territory information
    tests:
    - not_null
  - name: timeframe
    description: Custom timeframe field
    tests:
    - not_null
  - name: trial_start_date
    description: Start date of trial contact
    tests:
    - not_null
  - name: twitter_url
    description: Twitter profile URL of the lead
    tests:
    - not_null
  - name: unique_email
    description: Unique email identifier
    tests:
    - not_null
  - name: up_region_c
    description: ''
    tests:
    - not_null
  - name: user_gems_id
    description: Unique identifier from User Gems
    tests:
    - not_null
  - name: utm_campaign_c
    description: ''
    tests:
    - not_null
  - name: utm_content_c
    description: ''
    tests:
    - not_null
  - name: utm_id
    description: Unique identifier for UTM tracking
    tests:
    - not_null
  - name: utm_medium_c
    description: ''
    tests:
    - not_null
  - name: utm_source_c
    description: ''
    tests:
    - not_null
  - name: utm_term_c
    description: ''
    tests:
    - not_null
  - name: website
    description: Website of the lead
    tests:
    - not_null
  - name: zip_code
    description: Zip code of the lead
    tests:
    - not_null
  - name: zoominfo_company_id
    description: ZoomInfo company ID
    tests:
    - not_null
  - name: zoominfo_country
    description: Country information from ZoomInfo
    tests:
    - not_null
  - name: zoominfo_employee_count
    description: Employee count from ZoomInfo
    tests:
    - not_null
  - name: zoominfo_first_update_date
    description: Date of first ZoomInfo update
    tests:
    - not_null
  - name: zoominfo_id
    description: ZoomInfo unique identifier
    tests:
    - not_null
  - name: zoominfo_last_update_date
    description: Date of last ZoomInfo update
    tests:
    - not_null
  - name: zoominfo_state
    description: State information from ZoomInfo
    tests:
    - not_null
  - name: zoominfo_technologies
    description: Technologies used, from ZoomInfo
    tests:
    - not_null
  - name: zoominfo_zip_code
    description: Zip code from ZoomInfo
    tests:
    - not_null
  tests: []
10. stg_sf_contact_data
Table catalog prepared by Cocoon
version: 2
models:
- name: stg_sf_contact_data
  description: The table is about contact information. It contains details like name,
    email, phone, address, and job title. It also includes metadata such as creation
    date, last modified date, and owner ID. There are fields for marketing and sales
    tracking, like lead source and contact status. The table has many custom fields
    prefixed with various abbreviations, likely for specific business processes or
    integrations.
  columns:
  - name: contact_id
    description: Unique identifier for the contact record
    tests:
    - not_null
    - unique
    cocoon_meta:
      unique_reason: This column represents a unique identifier for each contact record.
        For this table, each row is for a single contact. contact_id is unique across
        rows.
  - name: account_id
    description: Unique identifier for the associated account
    tests:
    - not_null
  - name: clearbit_data
    description: Clearbit integration data
    tests:
    - not_null
  - name: clearbit_data_ready
    description: Indicates if Clearbit data is ready
    tests:
    - not_null
  - name: created_by_id
    description: ID of user who created the contact
    tests:
    - not_null
  - name: email
    description: Primary email address of the contact
    tests:
    - not_null
  - name: is_email_bounced
    description: Indicates if emails to contact bounced
    tests:
    - not_null
  - name: last_modified_by_id
    description: ID of user who last modified the record
    tests:
    - not_null
  - name: last_name
    description: Contact's last name
    tests:
    - not_null
  - name: mailing_city
    description: City for mailing address
    tests:
    - not_null
  - name: mailing_country
    description: Country for mailing address
    tests:
    - not_null
  - name: mailing_country_code
    description: Country code for mailing address
    tests:
    - not_null
  - name: mailing_state
    description: State for mailing address
    tests:
    - not_null
  - name: mailing_state_code
    description: State code for mailing address
    tests:
    - not_null
    - accepted_values:
        values:
        - IL
    cocoon_meta:
      future_accepted_values:
      - AL
      - AK
      - AZ
      - AR
      - CA
      - CO
      - CT
      - DE
      - FL
      - GA
      - HI
      - ID
      - IN
      - IA
      - KS
      - KY
      - LA
      - ME
      - MD
      - MA
      - MI
      - MN
      - MS
      - MO
      - MT
      - NE
      - NV
      - NH
      - NJ
      - NM
      - NY
      - NC
      - ND
      - OH
      - OK
      - OR
      - PA
      - RI
      - SC
      - SD
      - TN
      - TX
      - UT
      - VT
      - VA
      - WA
      - WV
      - WI
      - WY
      - DC
      - AS
      - GU
      - MP
      - PR
      - VI
  - name: mailing_street
    description: Street for mailing address
    tests:
    - not_null
  - name: name
    description: Full name of the contact
    tests:
    - not_null
  - name: owner_id
    description: Unique identifier for the record owner
    tests:
    - not_null
  - name: phone
    description: Primary phone number
    tests:
    - not_null
  - name: photo_url
    description: URL of contact's photo
    tests:
    - not_null
  - name: title
    description: ''
    tests:
    - not_null
  - name: email_bounced
    description: Indicates if email has bounced
    tests:
    - not_null
  - name: email_quality_unknown
    description: Indicates if email quality is unknown
    tests:
    - not_null
  - name: email_opt_out
    description: Email opt-out status
    tests:
    - not_null
  - name: created_by_clearbit
    description: Indicates if record created by Clearbit
    tests:
    - not_null
  - name: not_at_company_flag
    description: Flag if contact is no longer at company
    tests:
    - not_null
  - name: marketing_campaign
    description: Associated marketing campaign
    tests:
    - not_null
  - name: needs_score_sync
    description: Indicator for score synchronization need
    tests:
    - not_null
  - name: email_hard_bounced
    description: Indicator for hard bounced email
    tests:
    - not_null
  - name: pardot_prospect_url
    description: Pardot URL for the prospect
    tests:
    - not_null
    - unique
    cocoon_meta:
      unique_reason: This column contains a unique URL for each prospect in Pardot.
        For this table, each row is a contact. Assuming each contact has a unique
        Pardot URL, this could be a candidate key.
  - name: lead_source
    description: Source of the lead
    tests:
    - not_null
  - name: contact_status
    description: Current status of the contact
    tests:
    - not_null
    - accepted_values:
        values:
        - Attempting Contact
    cocoon_meta:
      future_accepted_values:
      - Contact Made
      - No Response
      - Not Attempted
      - Do Not Contact
      - Wrong Contact Information
      - Left Message
      - Scheduled Follow-up
      - Completed
      - Rejected
      - On Hold
  - name: leandata_routing_action
    description: Action taken by LeanData routing
    tests:
    - not_null
    - accepted_values:
        values:
        - converted
        - converted - new account
    cocoon_meta:
      future_accepted_values:
      - routed
      - not routed
      - matched
      - unmatched
      - assigned
      - reassigned
      - round robin
      - load balanced
      - merged
      - created new account
      - updated existing account
      - ignored
      - error
  - name: do_not_route_lead
    description: Indicates if lead should not be routed
    tests:
    - not_null
  - name: netsuite_sync_in_progress
    description: Flag if NetSuite sync is in progress
    tests:
    - not_null
  - name: netsuite_celigo_update_flag
    description: Flag for Celigo update in NetSuite connection
    tests:
    - not_null
  - name: push_to_netsuite_flag
    description: Flag to push data to NetSuite
    tests:
    - not_null
  - name: pushed_from_opportunity_flag
    description: Flag if pushed from opportunity to NetSuite
    tests:
    - not_null
  - name: description
    description: Description field
    tests:
    - not_null
  - name: is_eu_resident
    description: Indicates if the contact is an EU resident
    tests:
    - not_null
  - name: do_not_call
    description: Indicates if contact should not be called
    tests:
    - not_null
  - name: source_detail
    description: Detailed information about the contact's source
    tests:
    - not_null
  - name: secondary_latitude
    description: Latitude of secondary address
    tests:
    - not_null
  - name: secondary_longitude
    description: Longitude of secondary address
    tests:
    - not_null
  - name: conversion_date
    description: Date of lead conversion
    tests:
    - not_null
  - name: conversion_object_name
    description: Name of converted object
    tests:
    - not_null
  - name: conversion_object_type
    description: Type of converted object
    tests:
    - not_null
  - name: created_date
    description: Date and time of record creation
    tests:
    - not_null
  - name: email_bounce_reason
    description: Reason for email bounce
    tests:
    - not_null
  - name: email_bounced_date
    description: Date when email bounced
    tests:
    - not_null
  - name: email_opt_out_datetime
    description: Date and time of email opt-out
    tests:
    - not_null
  - name: first_activity_post_mql
    description: First activity type after MQL change
    tests:
    - not_null
  - name: first_activity_post_mql_date
    description: Date of first activity after MQL
    tests:
    - not_null
  - name: first_manual_activity_post_mql_date
    description: Date of first manual activity post-MQL
    tests:
    - not_null
  - name: fivetran_user_roles
    description: User roles in Fivetran account
    tests:
    - not_null
  - name: free_trial_confirmation_date
    description: Date of free trial email confirmation
    tests:
    - not_null
  - name: has_attended_event
    description: Indicates if contact attended an event
    tests:
    - not_null
  - name: last_customer_request_date
    description: Date of last customer request
    tests:
    - not_null
  - name: last_customer_update_date
    description: Date of last customer update
    tests:
    - not_null
  - name: last_interesting_moment_date
    description: Date of last interesting moment
    tests:
    - not_null
  - name: last_interesting_moment_description
    description: Description of last interesting moment
    tests:
    - not_null
  - name: last_interesting_moment_source
    description: Source of last interesting moment
    tests:
    - not_null
  - name: last_interesting_moment_type
    description: Type of last interesting moment
    tests:
    - not_null
  - name: last_modified_date
    description: Last modification timestamp in the system
    tests:
    - not_null
  - name: last_sdr_activity_date
    description: Date of last Sales Development Representative activity
    tests:
    - not_null
  - name: last_sdr_activity_owner
    description: Owner of last SDR activity
    tests:
    - not_null
  - name: mailing_postal_code
    description: Postal code for mailing address
    tests:
    - not_null
  - name: mql_date
    description: Date when contact became MQL
    tests:
    - not_null
  - name: mql_status_change_date
    description: Date when Marketing Qualified Lead status changed
    tests:
    - not_null
  - name: mql_status_change_reason
    description: Reason for Marketing Qualified Lead status change
    tests:
    - not_null
  - name: partner_company
    description: Name of partner company
    tests:
    - not_null
  - name: partner_contact
    description: Name of contact person at partner company
    tests:
    - not_null
  - name: partner_contact_deprecated
    description: Deprecated field for partner contact
    tests:
    - not_null
  - name: partner_rep_email
    description: Email of partner representative
    tests:
    - not_null
  - name: partner_rep_name
    description: Name of partner representative
    tests:
    - not_null
  - name: partner_territory
    description: Geographical territory of partner
    tests:
    - not_null
  - name: past_account
    description: Previous account information from UserGems
    tests:
    - not_null
  - name: past_company
    description: Previous company information from UserGems
    tests:
    - not_null
  - name: past_contact
    description: Previous contact information from UserGems
    tests:
    - not_null
  - name: past_job_title
    description: Previous job title from UserGems
    tests:
    - not_null
  - name: past_user_gems_info
    description: Past information from UserGems
    tests:
    - not_null
  - name: phone_extension
    description: Phone extension number
    tests:
    - not_null
  - name: pi_created_date_c
    description: ''
    tests:
    - not_null
  - name: referral_account
    description: Referral account
    tests:
    - not_null
  - name: referral_contact
    description: Referral contact
    tests:
    - not_null
  - name: referral_exists
    description: Whether a referral exists
    tests:
    - not_null
  - name: referral_first_name
    description: First name of referral
    tests:
    - not_null
  - name: referral_last_name
    description: Last name of referral
    tests:
    - not_null
  - name: secondary_city
    description: City in secondary address
    tests:
    - not_null
  - name: secondary_country
    description: Country in secondary address
    tests:
    - not_null
  - name: secondary_email
    description: Alternative email address for the contact
    tests:
    - not_null
  - name: secondary_geocode_accuracy
    description: Geocode accuracy for secondary address
    tests:
    - not_null
  - name: secondary_phone
    description: Secondary phone number
    tests:
    - not_null
  - name: secondary_postal_code
    description: Postal code of secondary address
    tests:
    - not_null
  - name: secondary_state
    description: State in secondary address
    tests:
    - not_null
  - name: system_modstamp
    description: ''
    tests:
    - not_null
  tests: []
11. snapshot_sf_contact_history_data
Table catalog prepared by Cocoon
version: 2
models:
- name: snapshot_sf_contact_history_data
  description: The table contains the latest contact information for individuals.
    It includes personal details like name, email, and address. It also captures professional
    information such as title and company. The table tracks the most recent activity
    dates and ownership data for each contact. It retains Salesforce IDs and flags
    for active status. This snapshot represents the current state of each contact
    record.
  columns:
  - name: is_active
    description: Indicates if the record is currently active
    tests:
    - not_null
  - name: contact_id
    description: Unique identifier for the contact record
    tests:
    - not_null
    - unique
    cocoon_meta:
      unique_reason: Unique dimension key, derived from the slowly changing dimension
  - name: account_id
    description: Unique identifier for associated company account
    tests:
    - not_null
  - name: email
    description: Contact's email address
    tests:
    - not_null
  - name: last_modified_by_id
    description: ID of user who last modified record
    tests:
    - not_null
  - name: last_name
    description: Contact's last name
    tests:
    - not_null
  - name: mailing_city
    description: City in contact's mailing address
    tests:
    - not_null
  - name: mailing_country
    description: Country in contact's mailing address
    tests:
    - not_null
  - name: mailing_country_code
    description: Country code in contact's mailing address
    tests:
    - not_null
  - name: mailing_state
    description: State in contact's mailing address
    tests:
    - not_null
  - name: mailing_street
    description: Street address in contact's mailing address
    tests:
    - not_null
  - name: full_name
    description: Full name of the contact
    tests:
    - not_null
  - name: owner_id
    description: ID of user who owns the contact record
    tests:
    - not_null
  - name: primary_phone
    description: Contact's primary phone number
    tests:
    - not_null
  - name: title
    description: title
    tests:
    - not_null
  - name: lead_source
    description: Source of the lead or contact
    tests:
    - not_null
  - name: description
    description: Additional notes or information about the contact
    tests:
    - not_null
  - name: home_phone
    description: Contact's home phone number
    tests:
    - not_null
  - name: last_activity_date
    description: Date of most recent activity with contact
    tests:
    - not_null
  - name: last_viewed_date
    description: Date record was last viewed
    tests:
    - not_null
  - name: mailing_postal_code
    description: Postal code in contact's mailing address
    tests:
    - not_null
  - name: mobile_phone
    description: Contact's mobile phone number
    tests:
    - not_null
  - name: reports_to_id
    description: ID of contact this person reports to
    tests:
    - not_null
  tests: []
12. stg_sf_account_data
Table catalog prepared by Cocoon
version: 2
models:
- name: stg_sf_account_data
  description: The table is about account data. It contains details like account number,
    source, revenue, billing and shipping addresses, industry, employees, ownership,
    and contact information. Some fields are encrypted. The table includes both active
    and deleted accounts. Each row represents a unique account with an ID. The data
    seems to be from a CRM system, likely Salesforce, given field names and structure.
  columns:
  - name: account_source
    description: Origin or method of account creation
    tests:
    - not_null
  - name: billing_city
    description: City for billing address
    tests:
    - not_null
  - name: billing_country
    description: Country for billing address
    tests:
    - not_null
  - name: billing_country_code
    description: Country code for billing address
    tests:
    - not_null
  - name: billing_latitude
    description: Latitude coordinate of billing address
    tests:
    - not_null
  - name: billing_longitude
    description: Longitude coordinate of billing address
    tests:
    - not_null
  - name: billing_postal_code
    description: Postal code for billing address
    tests:
    - not_null
  - name: billing_state
    description: State for billing address
    tests:
    - not_null
    - accepted_values:
        values:
        - FeSUdeQlOf7tk/xcziXTyw==
        - mAzuwdui02wrqGf2g7R4OA==
        - NWd5qaFpZxRID1f6P7ZtTA==
    cocoon_meta:
      future_accepted_values:
      - AL
      - AK
      - AZ
      - AR
      - CA
      - CO
      - CT
      - DE
      - FL
      - GA
      - HI
      - ID
      - IL
      - IN
      - IA
      - KS
      - KY
      - LA
      - ME
      - MD
      - MA
      - MI
      - MN
      - MS
      - MO
      - MT
      - NE
      - NV
      - NH
      - NJ
      - NM
      - NY
      - NC
      - ND
      - OH
      - OK
      - OR
      - PA
      - RI
      - SC
      - SD
      - TN
      - TX
      - UT
      - VT
      - VA
      - WA
      - WV
      - WI
      - WY
      - DC
      - AS
      - GU
      - MP
      - PR
      - VI
  - name: billing_state_code
    description: State code for billing address
    tests:
    - not_null
    - accepted_values:
        values:
        - Qpg7BeLyzCKCLjC+t73WaA==
        - uOqY3hqD9h0ZdgJ3QaRYvg==
        - Po0RXrSzK56UefOH2+FO4Q==
    cocoon_meta:
      future_accepted_values:
      - AL
      - AK
      - AZ
      - AR
      - CA
      - CO
      - CT
      - DE
      - FL
      - GA
      - HI
      - ID
      - IL
      - IN
      - IA
      - KS
      - KY
      - LA
      - ME
      - MD
      - MA
      - MI
      - MN
      - MS
      - MO
      - MT
      - NE
      - NV
      - NH
      - NJ
      - NM
      - NY
      - NC
      - ND
      - OH
      - OK
      - OR
      - PA
      - RI
      - SC
      - SD
      - TN
      - TX
      - UT
      - VT
      - VA
      - WA
      - WV
      - WI
      - WY
      - DC
      - AS
      - GU
      - MP
      - PR
      - VI
  - name: billing_street
    description: Street address for billing
    tests:
    - not_null
  - name: account_id
    description: Unique identifier for the account record
    tests:
    - not_null
    - unique
    cocoon_meta:
      unique_reason: This column represents a unique identifier for each account record.
        For this table, each row represents a distinct account, and the account_id
        is unique across rows.
  - name: industry
    description: Industry sector of the account
    tests:
    - not_null
  - name: is_deleted
    description: Indicates if the account is deleted
    tests:
    - not_null
  - name: master_record_id
    description: ID of the master record if duplicates exist
    tests:
    - not_null
  - name: account_name
    description: Name of the account
    tests:
    - not_null
  - name: owner_id
    description: ID of the account owner
    tests:
    - not_null
  - name: phone_number
    description: Primary phone number of the account
    tests:
    - not_null
  - name: profile_photo_url
    description: URL of the account's profile photo
    tests:
    - not_null
  - name: record_type_id
    description: Unique identifier for the record type
    tests:
    - not_null
  - name: shipping_country
    description: Country for shipping address
    tests:
    - not_null
  - name: shipping_country_code
    description: Country code for shipping address
    tests:
    - not_null
  - name: shipping_latitude
    description: Latitude coordinate of shipping address
    tests:
    - not_null
  - name: shipping_longitude
    description: Longitude coordinate of shipping address
    tests:
    - not_null
  - name: account_type
    description: Type or category of the account
    tests:
    - not_null
    - accepted_values:
        values:
        - account_type_1
        - account_type_2
    cocoon_meta:
      future_accepted_values:
      - Savings
      - Checking
      - Credit Card
      - Investment
      - Loan
      - Mortgage
      - Retirement
      - Business
      - Student
      - Joint
      - Trust
      - Money Market
      - Certificate of Deposit
      - IRA
      - 401(k)
      - Brokerage
      - Health Savings
      - Flexible Spending
      - Personal Line of Credit
  - name: is_active
    description: Indicates if the account is active
    tests:
    - not_null
  - name: billing_geocode_accuracy
    description: Accuracy of billing address geocoding
    tests:
    - not_null
  - name: employee_count
    description: Total number of employees in the company
    tests:
    - not_null
  - name: shipping_city
    description: City for shipping address
    tests:
    - not_null
  - name: shipping_geocode_accuracy
    description: Accuracy of shipping address geocoding
    tests:
    - not_null
  - name: shipping_postal_code
    description: Postal code for shipping address
    tests:
    - not_null
  - name: shipping_state
    description: State for shipping address
    tests:
    - not_null
  - name: shipping_state_code
    description: State code for shipping address
    tests:
    - not_null
  - name: shipping_street
    description: Street address for shipping
    tests:
    - not_null
  tests: []
13. snapshot_sf_account_history_data
Table catalog prepared by Cocoon
version: 2
models:
- name: snapshot_sf_account_history_data
  description: The table contains the latest version of Salesforce account data. It
    includes account details such as name, billing address, shipping address, and
    industry. Some fields are encrypted for security. The table tracks both active
    and deleted accounts. Each record has a unique ID and is associated with an owner.
    It provides a current snapshot of account information without historical versions.
  columns:
  - name: is_active
    description: Indicates if the record is currently active
    tests:
    - not_null
  - name: account_source
    description: Source of the account information
    tests:
    - not_null
  - name: billing_postal_code
    description: Postal code for billing address
    tests:
    - not_null
  - name: billing_state
    description: State for billing address
    tests:
    - not_null
    - accepted_values:
        values:
        - FeSUdeQlOf7tk/xcziXTyw==
        - mAzuwdui02wrqGf2g7R4OA==
        - NWd5qaFpZxRID1f6P7ZtTA==
    cocoon_meta:
      future_accepted_values:
      - AL
      - AK
      - AZ
      - AR
      - CA
      - CO
      - CT
      - DE
      - FL
      - GA
      - HI
      - ID
      - IL
      - IN
      - IA
      - KS
      - KY
      - LA
      - ME
      - MD
      - MA
      - MI
      - MN
      - MS
      - MO
      - MT
      - NE
      - NV
      - NH
      - NJ
      - NM
      - NY
      - NC
      - ND
      - OH
      - OK
      - OR
      - PA
      - RI
      - SC
      - SD
      - TN
      - TX
      - UT
      - VT
      - VA
      - WA
      - WV
      - WI
      - WY
      - DC
      - AS
      - GU
      - MP
      - PR
      - VI
  - name: billing_street
    description: Street address for billing
    tests:
    - not_null
  - name: record_id
    description: Unique identifier for the record
    tests:
    - not_null
    - unique
    cocoon_meta:
      unique_reason: Unique dimension key, derived from the slowly changing dimension
  - name: industry
    description: Industry of the account
    tests:
    - not_null
  - name: is_deleted
    description: Indicates if the account is deleted
    tests:
    - not_null
  - name: master_record_id
    description: ID of the master record if applicable
    tests:
    - not_null
  - name: account_name
    description: Name of the account
    tests:
    - not_null
  - name: owner_id
    description: ID of the account owner
    tests:
    - not_null
  - name: record_type_id
    description: ID of the record type
    tests:
    - not_null
  - name: shipping_country
    description: Country for shipping address
    tests:
    - not_null
  - name: account_type_encrypted
    description: Encrypted account type or category
    tests:
    - not_null
  - name: website_encrypted
    description: Encrypted website URL of the account
    tests:
    - not_null
  - name: employee_count
    description: Number of employees in the account
    tests:
    - not_null
  - name: shipping_city
    description: City for shipping address
    tests:
    - not_null
  - name: shipping_postal_code
    description: Postal code for shipping address
    tests:
    - not_null
  - name: shipping_state
    description: State for shipping address
    tests:
    - not_null
  - name: shipping_street
    description: Shipping street address of the account
    tests:
    - not_null
  tests: []
14. stg_sf_user_data
Table catalog prepared by Cocoon
version: 2
models:
- name: stg_sf_user_data
  description: The table contains Salesforce user data. It includes user details like
    name, email, phone, location, and account settings. The data has fields for user
    roles, profiles, and permissions. Some information is encrypted. The table tracks
    user activity with login dates and preferences. It stores both personal and professional
    details of users in the Salesforce system.
  columns:
  - name: is_deleted
    description: Indicates if the user record is deleted
    tests:
    - not_null
  - name: user_alias
    description: User's alternate name or nickname
    tests:
    - not_null
    - unique
    cocoon_meta:
      unique_reason: This column represents a user's alternate name or nickname. For
        this table, each row represents a unique Salesforce user. User aliases are
        typically unique across an organization's Salesforce instance.
  - name: badge_text
    description: Text displayed on user's badge
    tests:
    - not_null
  - name: banner_photo_url
    description: URL of user's banner photo
    tests:
    - not_null
  - name: community_nickname
    description: User's nickname in the community
    tests:
    - not_null
  - name: group_notification_frequency
    description: Frequency of group notifications
    tests:
    - not_null
    - accepted_values:
        values:
        - jZwwfLfzxKMoIqUZItHOqg==
    cocoon_meta:
      future_accepted_values:
      - Immediately
      - Daily
      - Weekly
      - Monthly
      - Never
  - name: delegated_approver_id
    description: ID of user's delegated approver
    tests:
    - not_null
  - name: digest_frequency
    description: Frequency of digest emails
    tests:
    - not_null
    - accepted_values:
        values:
        - unknown
    cocoon_meta:
      future_accepted_values:
      - daily
      - weekly
      - monthly
      - never
  - name: email
    description: User's email address
    tests:
    - not_null
    - unique
    cocoon_meta:
      unique_reason: This column contains the user's email address. In Salesforce,
        email addresses are typically unique for each user across the organization.
  - name: email_encoding_key
    description: Key for encoding user's emails
    tests:
    - not_null
  - name: auto_bcc_enabled
    description: Auto BCC preference for emails
    tests:
    - not_null
  - name: first_name
    description: User's first name
    tests:
    - not_null
  - name: forecast_enabled
    description: Indicates if forecasting is enabled for user
    tests:
    - not_null
  - name: full_photo_url
    description: URL of user's full-size photo
    tests:
    - not_null
  - name: user_id
    description: Unique identifier for the user
    tests:
    - not_null
    - unique
    cocoon_meta:
      unique_reason: This column contains a unique identifier for the user. In Salesforce,
        user IDs are guaranteed to be unique across the entire organization.
  - name: is_active
    description: Indicates if the user record is active
    tests:
    - not_null
  - name: is_profile_photo_visible
    description: Profile photo visibility status
    tests:
    - not_null
  - name: last_name
    description: User's last name
    tests:
    - not_null
  - name: locale_settings_key
    description: User's locale settings key
    tests:
    - not_null
  - name: manager_id
    description: Identifier for the user's manager
    tests:
    - not_null
  - name: medium_banner_photo_url
    description: URL for medium-sized banner photo
    tests:
    - not_null
  - name: full_name
    description: User's full name
    tests:
    - not_null
  - name: profile_id
    description: Identifier for the user's profile
    tests:
    - not_null
  - name: receives_admin_emails
    description: Admin email reception status
    tests:
    - not_null
  - name: receives_info_emails
    description: General info email reception status
    tests:
    - not_null
  - name: small_banner_photo_url
    description: URL for small-sized banner photo
    tests:
    - not_null
  - name: small_photo_url
    description: URL for small-sized profile photo
    tests:
    - not_null
  - name: time_zone_id
    description: User's time zone identifier
    tests:
    - not_null
  - name: role_id
    description: Identifier for user's role in the system
    tests:
    - not_null
  - name: username
    description: Unique identifier for the user's account
    tests:
    - not_null
    - unique
    cocoon_meta:
      unique_reason: This column contains a unique identifier for the user's account.
        In Salesforce, usernames are required to be unique across the entire organization.
  - name: _fivetran_active
    description: ''
    tests:
    - not_null
  - name: last_login_date
    description: Date and time of last login
    tests:
    - not_null
  - name: last_referenced_date
    description: Date the user was last referenced
    tests:
    - not_null
  - name: last_viewed_date
    description: Date the user last viewed something
    tests:
    - not_null
  - name: sender_email
    description: User's sender email address
    tests:
    - not_null
  - name: sender_name
    description: User's sender name
    tests:
    - not_null
  tests: []

Step 2: Power Copilot with RAG

Ask any question about data pipelines. The copilot knows your large data + pipeline, thanks to Cocoon RAG.

GitHub Logo

Cocoon is open-sourced

Need support or have questions? Contact Us