DOCUMENTATION HUB
  • Welcome
  • Platform
    • Platform Overview
    • Partners & Sites
    • Lender Hub Pipeline View
    • Landing Pages
    • Loan Assignment Links
    • Loan Officer Pages
    • Borrower Tasks
    • Borrower Document Uploads
    • Milestones
    • Troubleshooting Encompass eDisclosure packages
    • Testing Procedures
    • Blueprints
    • Sagas
      • Saga Methods Reference
    • Pushback Endpoints
    • Third Party Integrations
      • Credit Providers
        • CBC / Factual Data
        • Meridian Link
        • CoreLogic - CredCo
        • Informative Research
      • Loan Origination Systems (LOS)
        • BytePro
        • MortgageFlex
        • MeridianLink Mortgage
        • Encompass
      • Verification of Assets (VOA)
        • AccountChek by FormFree
        • Finicity
      • Verification of Employment/Income (VOIE)
        • The Work Number
      • Pricing Engines
        • Optimal Blue
        • Mortech
        • EPPS
        • PriceMyLoan
        • Polly
      • Payment Vendors
        • Celero Commerce (formerly Transnational)
      • AUS
        • Desktop Underwriter (DU)
        • Loan Product Advisor (LPA)
      • eSign
        • Dropbox Sign (formerly HelloSign)
        • DocuSign
        • EllieDocs
      • Fees
        • SmartFees
      • Customer Relationship Management (CRM)
        • SalesForce
        • TotalExpert
        • Velocify
      • Private Mortgage Insurance
    • Single Sign-On (SSO)
    • UI/UX Customizations
    • DNS Setup
    • Email White Labeling Setup
    • Notifications
    • Analytics
    • Pre-Qualification Letter
    • Teamwork
    • Reset Password
    • Webhooks
  • Encompass e-Disclosure Integration
  • Create Applications from Encompass Loans
  • Access Level Management
  • Lender Hub User Management
  • Reports Tab
  • API
    • API Overview
    • API Playground
  • Release Notes
    • Release Notes Overview
    • 2025 Release Notes
      • May 7th, 2025 Release Notes
      • April 9th, 2025 Release Notes
      • March 5th, 2025 Release Notes
      • February 5, 2025 Release Notes
      • January 8, 2025 Release Notes
    • 2024 Release Notes
      • December 4, 2024 Release Notes
      • November 6, 2024 Release Notes
      • October 10, New Feature Release: Task Due Dates & Notifications
      • October 2, 2024 Release Notes
      • September 4, 2024 Release Notes
      • August 7, 2024 Release Notes
      • July 10, 2024 Release Notes
      • June 5, 2024 Release Notes
      • May 1, 2024 Release Notes
      • April 3, 2024 Release Notes
      • March 11, 2024 Release Notes
      • February 6, 2024 Release Notes
      • January 24, 2024 Release Notes
      • January 10, 2024 Release Notes
    • 2023 Release Notes
      • December 27, 2023 Release Notes
      • December 12, 2023 Release Notes
      • November 29, 2023 Release Notes
      • November 15, 2023 Release Notes
      • November 1, 2023 Release Notes
      • October 17, 2023 Release Notes
      • September 27, 2023 Release Notes
      • September 6, 2023 Release Notes
      • August 16, 2023 Release Notes
      • August 15, 2023 Release Notes
      • July 27, 2023 Release Notes
      • June 27, 2023 Release Notes
      • June 7, 2023 Release Notes
      • May 17, 2023 Release Notes
      • April 25, 2023 Release Notes
      • April 4, 2023 Release Notes
      • March 15, 2023 Release Note
      • February 21, 2023 Release Notes
      • January 31, 2023 Release Notes
      • January 4, 2023 Release Notes
    • 2022 Release Notes
      • December 7, 2022 Release Notes
      • November 15, 2022 Release Notes
      • November 1, 2022 Release Notes
      • October 4, 2022 Release Notes
      • September 13, 2022 Release Notes
      • August 31, 2022 Release Notes
      • August 2, 2022 Release Notes
      • July 13, 2022 Release Notes
      • June 22, 2022 Release Notes
      • June 1, 2022 Release Notes
      • May 10, 2022 Release Notes
      • Apr 19, 2022 Release Notes
      • Mar 29, 2022 Release Notes
      • Mar 8, 2022 Release Notes
      • Feb 15, 2022 Release Notes
      • Jan 25, 2022 Release Notes
      • Jan 5, 2022 Release Notes
    • 2021 Release Notes
      • Dec 21, 2021 Release Notes
      • Nov 22, 2021 Release Notes
      • Nov 2, 2021 Release Notes
      • Oct 12, 2021 Release Notes
      • Sep 22, 2021 Release Notes
      • Aug 24, 2021 Release Notes
      • Aug 4, 2021 Release Notes
      • Jun 22, 2021 Release Notes
      • May 28, 2021 Release Notes
      • May 12, 2021 Release Notes
      • Apr 13, 2021 Release Notes
      • Mar 23, 2021 Release Notes
      • Feb 26, 2021 Release Notes
      • Feb 9, 2021 Release Notes
    • 2020 Release Notes
      • Dec 1, 2020 Release Notes
      • Nov 10, 2020 Release Notes
      • Oct 20, 2020 Release Notes
      • Sep 28, 2020 Release Notes
      • Sep 13, 2020 Release Notes
      • Aug 17, 2020 Release Notes
      • Jul 30, 2020 Release Notes
      • Jul 13, 2020 Release Notes
      • May 28, 2020 Release Notes
      • May 5, 2020 Release Notes
  • Client Resources
    • Client Resources Overview
    • Third Party Integrations Overview
    • Maxwell Onboarding Overview
    • Support Portal Quick Reference
    • Lender Hub User Management
    • Duplication of Applications
  • Broker Origination System (BOS)
    • Borrower Tasks in the Lender Hub
    • Exporting Client Documents from the Lender Hub
    • Exporting the MISMO 3.4 from the Lender Hub
    • Reset Password
  • Maxwell Business Intelligence
    • Data Dictionary
Powered by GitBook
On this page
  • What is a Saga?
  • Blueprint Driven Events
  • Backend Driven Events
  • Task Events
  • Milestone Events
  • Document Events
  • Integration Responses
  • Agent Assignment
  • Workflow Events
  1. Platform

Sagas

What is a Saga?

A saga is a small set of code instructions that call different saga methods to complete a variety of tasks, such as send notifications, push data to an LOS, talk to third-party integrations, modify information, etc.

  • Sagas are event driven

  • Sagas can be customized per Partner and per Site.

  • Within a Saga, we can call many saga methods in a sequence, including sending a particular notification (email or SMS).

  • Right now Sagas can only be created and modified directly in the database by a developer, but coming soon there will be a saga editor in the Customization Hub.

Sagas can be triggered to run when certain events occurs within the platform. With a powerful set of sagas each site's functionality can be highly customized.

Following is a sample saga that finds a loan, finds the associated Agent (LO), pushes the loan to Desktop Underwriter, Encompass LOS and sends a notification to the Agent.

# Find the Loan
loan = find 'loan', params.loan_id

# Assign to an Agent based on the Purpose Type of the Loan
if loan.purpose_type == 'Purchase'
  agent = find 'agent', { purpose_type: 'Purchase' }
elsif loan.purpose_type == 'Refinance'
  agent = find 'agent', { purpose_type: 'Refinance' }
end

# Push the Loan to DU
du_response = loan_file_push_to_desktop_underwriter loan.id
save_response_to_database du_response

# Push the Loan to Encompass
loan_file_push_to_encompass_api loan.id

# Send custom notification to Agent
send_notification! 'loan_pushed_to_encompass', agent.id, loan.site_id

# Send custom notification to Borrowers introducing them to Agent
primary_applicant = loan.primary_applicant
send_notification! 'agent_assigned', primary_applicant.id, loan.site_id

# Push data to custom endpoint
url = 'https://your-domain.com/endpoint'
http_post url, { body: loan.data }

There are 2 types of events that can trigger a saga to run:

  1. Blueprint driven events

  2. Backend drive events

Blueprint Driven Events

When a particular task in a blueprint is completed, the blueprint can specify that a particular saga should be run.

Blueprint sagas will only run the first time a task is completed. They will not run if a task is completed a second time.

Currently this behavior can only be configured by manually editing the Blueprint JSON. But in a coming release the Blueprint editor will allow changing this more easily.

Backend Driven Events

The backend will run a Saga with a corresponding Saga name when any of the following backend "Objects" are Created or Updated. It requires some understanding of how the backend works to understand which front-end actions will trigger which back-end events.

Backend event-driven sagas are also known as "Callback Sagas".

Task Events

  • When a task is created or updated, including status change such as a task being completed

  • The Sagas that run will be able to check for task attributes such as the task name / type to determine e.g. which notification should be sent.

Milestone Events

  • Whenever a milestone is changed

  • This may be unintuitive - when the active milestone changes then both the previously active milestone and the newly active milestone will both be updated. Milestones will be created when the application file is first created, so the “create” event here is not very useful.

Document Events

  • Lender Documents - Documents uploaded by an Agent in the "lender documents" section.

  • Sent Documents - Documents uploaded by an Agent in the "sent documents" section.

  • Submitted Documents - Documents uploaded by a Borrower OR an Agent in the "submitted documents" section.

Integration Responses

Any saved response from an integration, e.g.

  • Credit Pull

  • LOS Loan File Push

  • LOS Document Push

  • AUS (DU) Run

  • Pre-approval Letter Creation

  • etc.

Agent Assignment

  • When an agent is assigned to an application file

  • When an agent is assigned to a site

  • When an agent is assigned to a role

Workflow Events

Also known as LOS Milestones

Saga Specifications

PreviousBlueprintsNextSaga Methods Reference

Last updated 1 year ago

The full saga methods reference can .

be found here