{% extends "vcelerytaskrunner/layout.html" %} {% block title %}Task Run{% endblock %} {% block content %}
{% if task_id %}

Task invocation completed. The task ID is {{ task_id }}. NOTE that this only means the task was invoked. That task may still be running or fail. Check logs for the task ID to see its run status.

You can run another instance of the task by entering the information below.

{% endif %}

Instructions on how to pass parameters to the task:

Each parameter of the task is shown in the list below with the type as provided by type hints of the task. You can provide values for each parameter to invoke the task with. If there is no type hint available, the type str is assumed.

Primitive types (such as int, str, bool) work fine. Using only these types and List[primitive type] and dict[str, ...] (basically anything that can be serialized as JSONs) for your Celery tasks (see note below) will ensure things work correctly.

Having said that, if you are using the older "pickle" serialization with your Celery setup, some other more sophisticated types are supported with some nuance:

  • datetime -- should be entered as an ISO 8601-compliant long form string value (e.g. 2024-11-24T20:00:00-08:00).
  • custom Pydantic BaseModel -- should be entered as a JSON that the model can parse via its model_validate_json().

NOTE on Celery serialization: If you use non-primitive types for your Celery setup, you should also use a serializer (e.g. "pickle") that supports the types. This is not a requirement of this tool but of Celery in general. Recent versions of Celery by default use the "json" serializer by default and therefore will not support datetime or custom types.

{% if error_message %}
Task invocation FAILED. The error was {{ error_message }}.
{% endif %}
{{ form.errors }}
{% csrf_token %}
{{ task }}({{ task_param_displays|join:", " }})
{% if task_params %}
{% for task_param in task_params %} {% if task_param.type_info %}
{{ task_param.name }} ({{ task_param.type_info }}{% if task_param.is_base_model %}, JSON possible{% endif %}):
{% else %}
{{ task_param.name }}:
{% endif %}
{% if task_param.default %} {% else %} {% endif %}
{% endfor %}
{% endif %}
{% endblock %}