trpc-agent-go is a Go framework for building intelligent agent systems using LLMs. It enables operations teams to automate complex workflows by integrating LLMs with tools. The framework supports agents like Claude and connects to various business applications.
git clone https://github.com/trpc-group/trpc-agent-go.githttps://trpc-group.github.io/trpc-agent-go/
1. **Install trpc-agent-go**: Clone the repository (https://github.com/trpc-group/trpc-agent-go) and follow the setup instructions. Ensure you have Go 1.20+ installed. 2. **Define Your Workflow**: Break down the automation task into discrete steps (e.g., API calls, notifications, data processing). Use [PLACEHOLDERS] in the prompt_template to specify these steps. 3. **Configure Tools**: Identify the tools your workflow needs (e.g., BambooHR, Slack, Google Workspace). Refer to the trpc-agent-go documentation to integrate these tools. For example: ```go tools.NewBambooHRTool("https://api.bamboohr.com/api/gateway.php/{companyDomain}", "{apiKey}") ``` 4. **Write the Go Code**: Use the provided Go snippet as a template. Replace placeholders (e.g., `{serviceAccountKeyPath}`, `{slackBotToken}`) with your actual credentials. Add error handling for edge cases (e.g., rate limits, missing data). 5. **Test and Iterate**: Run the workflow in a staging environment first. Use the agent's logging to debug issues. For complex workflows, break them into smaller sub-workflows and test each step independently. **Tips for Better Results:** - Use the `agent.WithLogger()` option to capture detailed logs for debugging. - For dynamic workflows, use the agent's context to pass data between steps (e.g., employee email from Step 1 to Step 2). - Leverage trpc-agent-go's retry mechanisms for transient failures (e.g., API timeouts).
Create customer support bots that understand and resolve complex queries.
Develop data analysis assistants that can query databases and generate insightful reports.
Automate DevOps processes such as deployment and monitoring with intelligent agents.
Implement business process automation with multi-step workflows that include human oversight.
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/trpc-group/trpc-agent-goCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Use the trpc-agent-go framework to automate the following workflow: [DESCRIBE_THE_WORKFLOW]. Identify the key steps, tools, and APIs required to execute this workflow. Generate a Go code snippet using trpc-agent-go that implements this automation, including error handling and logging. Ensure the agent can handle [SPECIFIC_EDGE_CASES] and provide a summary of the expected output.
### Workflow Automation with trpc-agent-go
**Workflow Description:** Automate the onboarding of new employees by integrating with HRIS (BambooHR), Slack for notifications, and Google Workspace for account provisioning.
**Key Steps Identified:**
1. Fetch new employee data from BambooHR API.
2. Create Google Workspace accounts (Gmail, Drive, Calendar).
3. Send a welcome message to the employee's Slack channel.
4. Log the entire process and handle errors (e.g., API failures, duplicate accounts).
**Go Code Snippet (trpc-agent-go):**
```go
package main
import (
"context"
"fmt"
"log"
"trpc-agent-go/agent"
"trpc-agent-go/tools"
)
type Employee struct {
Name string `json:"name"`
Email string `json:"email"`
Role string `json:"role"`
SlackUID string `json:"slack_uid"`
}
func main() {
// Initialize the agent
a := agent.NewAgent(
agent.WithTools(
tools.NewBambooHRTool("https://api.bamboohr.com/api/gateway.php/{companyDomain}", "{apiKey}"),
tools.NewGoogleWorkspaceTool("{serviceAccountKeyPath}"),
tools.NewSlackTool("{slackBotToken}"),
),
agent.WithLogger(log.Default()),
)
// Define the workflow
workflow := func(ctx context.Context, input Employee) error {
// Step 1: Fetch employee data from BambooHR
employeeData, err := a.CallTool(ctx, "bamboohr_get_employee", map[string]interface{}{"employee_id": input.Email})
if err != nil {
return fmt.Errorf("failed to fetch employee data: %v", err)
}
// Step 2: Create Google Workspace account
account, err := a.CallTool(ctx, "google_workspace_create_account", map[string]interface{}{
"email": input.Email,
"name": input.Name,
})
if err != nil {
return fmt.Errorf("failed to create Google account: %v", err)
}
// Step 3: Send Slack welcome message
_, err = a.CallTool(ctx, "slack_send_message", map[string]interface{}{
"channel": input.SlackUID,
"message": fmt.Sprintf("Welcome %s! Your accounts have been created.", input.Name),
})
if err != nil {
return fmt.Errorf("failed to send Slack message: %v", err)
}
// Step 4: Log success
log.Printf("Successfully onboarded employee: %s", input.Name)
return nil
}
// Execute the workflow
if err := workflow(context.Background(), Employee{
Name: "Alex Johnson",
Email: "alex.johnson@company.com",
Role: "Software Engineer",
SlackUID: "U12345678",
}); err != nil {
log.Fatalf("Workflow failed: %v", err)
}
}
```
**Expected Output:**
- BambooHR API call returns employee data for Alex Johnson.
- Google Workspace tool creates a Gmail account (`alex.johnson@company.com`) and grants access to Drive/Calendar.
- Slack tool posts a welcome message in the `#new-hires` channel.
- The agent logs: `2024/05/20 14:30:00 Successfully onboarded employee: Alex Johnson`.
**Error Handling:**
- If BambooHR returns an error (e.g., employee not found), the agent logs: `2024/05/20 14:30:01 failed to fetch employee data: employee not found`.
- If Google Workspace fails (e.g., email already exists), the agent retries once and then aborts with a clear error.Unlock data insights with interactive dashboards and collaborative analytics capabilities.
IronCalc is a spreadsheet engine and ecosystem
ITIL-aligned IT service management platform
Customer feedback management made simple
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan