Webagent icon

Webagent

Interact with Webagent

Actions3

Overview

The node "Webagent" allows users to create and run tasks on the Webagent platform. Specifically, the "Create And Run Task" operation under the "Task Run" resource enables initiating a task with a given prompt and optional parameters such as an initial URL, authentication context, session timeout, and response format. This node is useful for automating workflows that require running tasks remotely on Webagent, such as data extraction, web automation, or custom scripted interactions.

Practical examples include:

  • Running a web scraping task by providing a prompt describing the data to extract.
  • Automating a multi-step web interaction starting from a specific URL.
  • Executing a task that requires authentication context to access protected resources.
  • Receiving the task output either as plain text or structured JSON according to a schema.

Properties

Name Meaning
Prompt The prompt to run the task with. This is the main input describing what the task should do.
Response Format The format of the response returned by the task. Options: Text, JSON.
JSON Schema (Optional) A JSON schema defining the expected structure of the response when using JSON format.
Initial URL An optional starting URL for the task to begin its operation.
Auth Context Name or ID Select or specify an authentication context to use for the task, enabling access to protected resources.
Session Timeout Timeout duration in seconds for the task session before it is terminated. Default is 300 seconds.
Wait for Completion Whether the node should wait for the task to complete before returning results. Default is true.

Output

The node outputs the result of the executed task in the json field of the output data. Depending on the selected "Response Format," this can be:

  • Text: A plain text string representing the task's output.
  • JSON: A structured JSON object conforming optionally to the provided JSON schema.

If the task produces binary data, it would typically be handled separately, but based on the provided properties and code, the node focuses on JSON/text responses.

Dependencies

  • Requires an API key credential for authenticating with the Webagent API.
  • Connects to the Webagent cloud API at https://api.webagent.cloud.
  • Uses helper methods to load available authentication contexts and tasks dynamically.
  • Requires network connectivity to the Webagent service endpoint.

Troubleshooting

  • Authentication errors: Ensure the API key credential is correctly configured and has necessary permissions.
  • Timeout issues: If tasks take longer than the specified session timeout, increase the "Session Timeout" property.
  • Invalid JSON schema: When using JSON response format, ensure the provided JSON schema is valid; otherwise, parsing errors may occur.
  • Empty or incorrect prompt: The "Prompt" property is required; missing or malformed prompts will cause the task to fail.
  • Waiting for completion: If "Wait for Completion" is false, the node returns immediately and may not have task results yet.

Links and References

Discussion