Overview
invoke_skill and poll_skill provide non-blocking skill task execution. invoke_skill sends a non-blocking request to the AgentKit skills sandbox via the A2A protocol, creates a skill task, and returns the initial task object immediately. poll_skill fetches the current status snapshot of a task by its task ID. Used together, they let you start a long-running skill workflow without blocking the agent’s reasoning and poll for status on demand.
Compared to execute_skills:
Use cases:
- The skill workflow takes a long time and you do not want to block a single tool call waiting for completion;
- You need to perform other work after starting a skill task and check the result later;
- You need custom control over how and when to poll.
invoke_skill and poll_skill reuse the sandbox infrastructure and credential configuration of execute_skills. Environment variables, Tool IDs, inbound identity credentials, and other prerequisites are the same as those described on the Code sandbox page.Usage
Import path:Agent tools list. The agent can then call invoke_skill to start a skill task and poll_skill to query its status during reasoning.
skill_tasks_agent.py
Task object
Bothinvoke_skill and poll_skill return an A2A task object (dict) containing the following key fields:
Task states:
submitted and working indicate unfinished work, while unknown means the state is undetermined. completed, failed, canceled, and rejected end execution. input-required and auth-required need external action and are not success. VeADK waiting tools stop waiting at these two states, but the A2A protocol can allow later changes. Each poll_skill call queries the server again; its response is not guaranteed to be an immutable snapshot.
invoke_skill
Creates an A2A skill task and returns the initial task object. Sends a non-blockingmessage/send request without waiting for the task to complete.
tool_context is marked optional in the signature but is required at call time; omitting it raises an error. VeADK injects it automatically during agent execution — you do not need to pass it manually.poll_skill
Fetches the current status snapshot of an A2A skill task. Sends atasks/get request and returns the task object.
tool_context is marked optional in the signature but is required at call time; omitting it raises an error. VeADK injects it automatically during agent execution — you do not need to pass it manually.Security
Context for task queries
invoke_skill still establishes a sandbox session and completes a network request before returning. Nonblocking means it does not wait for the whole workflow. Preserve the returned task id and query with the same Tool ID, user, and session context; another session is not guaranteed access to that task.
Polling does not create a new task. Limit polling frequency and handle required input or authorization for input-required and auth-required, instead of repeatedly submitting the workflow. After completed, read the output or artifacts before delivering a result; an ID or state string is insufficient.