What is the best way to automate the periodic deletion of all records in a database that are not connected to a card? (The records are the children the parent cards in the connection)
Great question — and a common use case for maintaining clean and efficient data structures in Pipefy!
If you want to periodically delete all database records that are not connected to any card (i.e., orphaned child records), here’s the best way to automate that.
Recommended Solution: Using Pipefy GraphQL API + Scheduler (Make, n8n, or custom script)
🧠 Why the API is necessary:
Pipefy does not offer a native automation to delete records or filter database items based on whether they're connected or not. But using the GraphQL API, you can:
-
Fetch all records in a database.
-
Check their connections (via
connectedCardsCount
or reverse lookups). -
Delete the ones that have no connections.
️ Step-by-Step (Using Make.com or n8n.io)
1. Create a recurring trigger
-
Run every X days/hours using a scheduler module.
2. Query your database
Use the GraphQL query to list all database records and their connection counts:
{
table_records(table_id: "your_table_id", first: 100) {
edges {
node {
id
title
connected_cards_count
}
}
}
}
If connected_cards_count == 0
, it means the record is not linked to any card.
Alternatively, if you have a reverse connection set up from the parent pipe to the child records, you can also query through that connection field.
3. Filter the unconnected records
Use logic in your automation tool to filter only records with connected_cards_count === 0
.
4. Delete unconnected records
Use the mutation:
mutation {
deleteTableRecord(input: {id: "record_id"}) {
success
}
}
Loop through each orphaned record and delete it.
API Docs: https://developers.pipefy.com/
🔒 Important Notes
-
Only users with permission to delete database records can use this API mutation.
-
Make sure you log or back up deletions if needed for auditability.
-
You might need pagination if your database has more than 100 records — handle
pageInfo.hasNextPage
.
Bonus: Add a Manual "Clean Now" Trigger
You can also expose this as a webhook or manual button for staff to trigger cleanup when needed — without waiting for the next scheduled run.
Thank you for your quick reply!
In Step 2 of your suggested solution, I’m getting an error: “Field 'connected_cards_count' doesn't exist on type 'TableRecordWithCount'”.
Please advise.
In this one, you need to create a code to storage the amount of ids returned and put in a variable.
What is the best way to automate the periodic deletion of all records in a database that are not connected to a card check amdarklimited.com? (The records are the children the parent cards in the connection)
The best way is to set up an automated scheduled task that periodically deletes all child records not linked to a parent card. This can be done using your database's built-in scheduler or an external task scheduler like cron. The task should run a query that checks for and removes records without a valid connection to a card. This ensures your data stays clean without manual intervention.
In case this helps anyone else:
My problem was how to check for records that aren’t connected to a parent card.
As of now, Pipefy’s graphql API doesn’t expose that information directly from the records.
To get this information, you have to work backwards - query for all the cards in the pipe and their child records, save a list of ‘child record’ IDs, and then delete all records in the database that aren’t in the list.
Query to get list of cards and their child records:
{ allCards(pipeId:"*********") { nodes { title child_relations { cards { title id } } } }}
What is the best way to automate the periodic deletion of all records in a database that are not connected to a card check texas roadhouse lunch hours (The records are the children the parent cards in the connection)
The best way is to set up an automated scheduled task that periodically deletes all child records not linked to a parent card. This can be done using your database's built-in scheduler or an external task scheduler like cron. The task should run a query that checks for and removes records without a valid connection to a card. This ensures your data stays clean without manual intervention.
Cleaning up unused database records is an important step in maintaining system performance, reducing storage costs, and ensuring data integrity. Over time, applications often accumulate obsolete or redundant entries that can slow down queries and make the database harder to manage. Regularly identifying and removing these unused records helps improve efficiency, enhances data accuracy, and minimizes the risk of errors.
Reply
Join us in the Pipefy Community! 🚀
No account yet? Create an account
Login with your Pipefy credentials
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.