Hey @████████ - it's been a while!
It it a lot more complicated that you would think.
Lucky for you - I've already been working on a similar process. I send these weekly emails to staff members who have been sitting on forms without completing them, and I want to automate the process, so I'd been researching how that part of the database works, and I've nearly got my process complete.
So here's a query that you can use, that basically mimics what you see in the "Monitor" page in LFForms.
When testing, you may see more results returned than when you review the "Monitor" page, because in the case of a form assigned to multiple users, it'll have a separate line item in the query results for each user. In the case of a form assigned to a team, but it hasn't been claimed by a team member (it's showing "available") the query will return whichever user(s) is/are assigned as the "manager" for the team.
You'll notice that part of the WHERE statement is commented out (the part that limits the search to processes that have been open for a certain amount of time - showing 15 days currently) - I left that out so it is easier to compare to your "monitor" page.
USE [LFForms]
GO
SELECT
subquery.[Process Name],
subquery.[Instance name],
subquery.[Started by],
subquery.[Last updated],
subquery.[Assigned to],
subquery.[Assigned to (username)],
subquery.[Assigned to (email)],
subquery.[Current step],
subquery.[Step start date],
subquery.[Start date],
subquery.[Instance ID]
FROM (
SELECT
instance.bp_name AS [Process Name],
instance.title AS [Instance name],
CASE
WHEN start_user_snapshot.displayname LIKE '%WORKFLOW%' THEN 'Workflow'
ELSE start_user_snapshot.displayname
END AS [Started by],
instance.lastacted_date AS [Last updated],
CASE
WHEN bp_worker_resume.status = 5 THEN assigned_user_snapshot.displayname
WHEN bp_worker_resume.status = 2 THEN assigned_user_snapshot.displayname
WHEN assigned_user_team_snapshot.displayname IS NULL THEN teams.name
WHEN bp_worker_resume.status = 1 THEN assigned_user_team_snapshot.displayname
END AS [Assigned to],
CASE
WHEN bp_worker_resume.status = 5 THEN assigned_user_snapshot.username
WHEN bp_worker_resume.status = 2 THEN assigned_user_snapshot.username
WHEN assigned_user_team_snapshot.displayname IS NULL THEN team_users.username
WHEN bp_worker_resume.status = 1 THEN assigned_user_team_snapshot.username
END AS [Assigned to (username)],
CASE
WHEN bp_worker_resume.status = 5 THEN assigned_user_snapshot.email
WHEN bp_worker_resume.status = 2 THEN assigned_user_snapshot.email
WHEN assigned_user_team_snapshot.displayname IS NULL THEN team_users.email
WHEN bp_worker_resume.status = 1 THEN assigned_user_team_snapshot.email
END AS [Assigned to (email)],
bp_worker_resume.step_name AS [Current step],
bp_worker_resume.assign_date AS [Step start date],
instance.start_date AS [Start date],
instance.bp_instance_id AS [Instance ID]
FROM cf_bp_main_instances AS instance
LEFT JOIN cf_user_snapshot AS start_user_snapshot ON start_user_snapshot.id = instance.user_snapshot_id
LEFT JOIN cf_bp_worker_instances AS bp_worker ON bp_worker.bp_instance_id = instance.bp_instance_id
LEFT JOIN cf_bp_worker_instnc_to_resume AS bp_worker_resume ON bp_worker_resume.worker_instance_id = bp_worker.instance_id
LEFT JOIN cf_bp_worker_instance_history AS bp_worker_history ON bp_worker_history.instance_id = bp_worker.instance_id AND bp_worker_history.status = 'assigned' AND bp_worker_resume.owner_snapshot_id IS NULL
LEFT JOIN cf_user_snapshot AS assigned_user_snapshot ON assigned_user_snapshot.id = bp_worker_resume.owner_snapshot_id
LEFT JOIN cf_user_snapshot AS assigned_user_team_snapshot ON assigned_user_team_snapshot.id = bp_worker_history.target_snapshot_id
LEFT JOIN teams AS teams ON teams.id = bp_worker_resume.team_id AND bp_worker_resume.owner_snapshot_id IS NULL
LEFT JOIN team_members AS team_members ON team_members.team_id = teams.id AND team_members.member_rights = 3
LEFT JOIN cf_users AS team_users ON team_users.user_id = team_members.user_id
WHERE instance.status = 1
AND (bp_worker_resume.status = 5 OR bp_worker_resume.status = 1 OR bp_worker_resume.status = 2)
AND bp_worker_resume.assign_date IS NOT NULL
--AND instance.start_date <= DATEADD(DAY, -15, GETDATE())
) AS subquery
GROUP BY subquery.[Process Name], subquery.[Instance name], subquery.[Started by], subquery.[Last updated], subquery.[Assigned to], subquery.[Assigned to (username)], subquery.[Assigned to (email)], subquery.[Current step], subquery.[Step start date], subquery.[Start date], subquery.[Instance ID]
ORDER BY subquery.[Start date]