Actions8
Overview
This node integrates with the Scrapybara API to manage and interact with virtual instances. Specifically, the "Run Bash Command" operation allows users to execute arbitrary bash commands on a specified instance remotely. This is useful for automating server management tasks, running scripts, or performing maintenance operations without manual SSH access.
Practical examples include:
- Running update or installation commands on a remote Ubuntu instance.
- Executing diagnostic commands to check system status.
- Automating deployment scripts or configuration changes on cloud instances.
Properties
| Name | Meaning |
|---|---|
| Instance ID | The unique identifier of the instance on which the bash command will be executed. |
| Command | The bash command string to run on the instance. |
| Restart Shell | Boolean flag indicating whether to restart the shell before running the command. |
Output
The output JSON contains the following fields:
success: A boolean indicating if the command ran successfully (true if no error).instanceId: The ID of the instance where the command was executed.result: An object containing the result of the bash command execution. It may include standard output, standard error, exit code, or an error field if the command failed.
No binary data is output by this operation.
Example output JSON structure:
{
"success": true,
"instanceId": "abc123",
"result": {
"stdout": "Command output here",
"stderr": "",
"exitCode": 0
}
}
Dependencies
- Requires an active connection to the Scrapybara API via an API key credential.
- The node uses the Scrapybara client library to communicate with the API.
- Proper permissions on the target instance are necessary to run bash commands.
Troubleshooting
Common issues:
- Invalid or expired API key leading to authentication failures.
- Incorrect instance ID causing "instance not found" errors.
- Bash command syntax errors resulting in command failure.
- Network connectivity problems between n8n and the Scrapybara service.
Error messages:
Failed to run bash command on instance <ID>: <error message>indicates the command could not be executed. Check the instance ID, command syntax, and API connectivity.- If the node throws errors about missing parameters, ensure all required properties (Instance ID and Command) are provided.
To resolve errors:
- Verify the API key credential is valid and has necessary permissions.
- Confirm the instance ID exists and is accessible.
- Test the bash command independently on the instance to ensure correctness.
- Enable "Continue On Fail" in the node settings to handle errors gracefully during workflows.
Links and References
- Scrapybara API Documentation (hypothetical link)
- Bash Scripting Guide
- n8n Documentation on Using Credentials