When to advise palliative care

When do patients benefit most from palliative care consults?