Liz Cochrane told a Fatal Accident Inquiry at Paisley Sheriff Court she was right to bring the toddler's case to a close.
That was in August 2009, but in March 2010 the one-year-old's body was found in his litter-filled cot.
He had been dead for months, with experts believing he may have died in September - the month after Ms Cochrane and her colleagues stopped working with Hainey's mother Kimberley.
Giving evidence at the inquiry, Ms Cochrane, a senior social worker, said she believed she had dealt with the case properly.
She said she met Jill Stevenson, Kimberley Hainey's drug worker, on August 6, 2009, where Ms Stevenson asked her to close the case.
And Ms Cochrane insisted that, based on what she knew at the time, she took the right decision.
She said: "My decision to close the case was nine months after we had received the case.
"The information about her medical history, alcohol and drug misuse appeared to have been resolved.
"To my knowledge she was not abusing substances, she was not self-harming and not showing she had any issues in terms of her mental health."
But she said that, had she known the full background of Declan's heroin-addicted mother she would not have agreed to close the case.
Kimberley Hainey was later jailed for life for neglecting and murdering Declan, but she was released on appeal.
The inquiry continues next week.