def get_task_prerun_attachment(task_id, task, args, kwargs, **cbkwargs):
    """Create the slack message attachment for a task prerun."""
    message = 'Executing -- ' + task.name.rsplit('.', 1)[-1]
    lines = ['Name: *' + task.name + '*']
    if cbkwargs['show_task_id']:
        lines.append('Task ID: ' + task_id)
    if cbkwargs['use_fixed_width']:
        if cbkwargs['show_task_args']:
            lines.append('args: ' + '`' + str(args) + '`')
        if cbkwargs['show_task_kwargs']:
            lines.append('kwargs: ' + '`' + str(kwargs) + '`')
    else:
        if cbkwargs['show_task_args']:
            lines.append('args: ' + str(args))
        if cbkwargs['show_task_kwargs']:
            lines.append('kwargs: ' + str(kwargs))
    executing = '\n'.join(lines)
    attachment = {'attachments': [{'fallback': message, 'color': cbkwargs[
        'slack_task_prerun_color'], 'text': executing, 'title': message,
        'mrkdwn_in': ['text']}], 'text': ''}
    if cbkwargs['flower_base_url']:
        attachment['attachments'][0]['title_link'] = cbkwargs['flower_base_url'
            ] + '/task/{tid}'.format(tid=task_id)
    return attachment
