> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cogniagent.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Action Nodes

> Do things - send emails, use AI, update spreadsheets, and more

Action nodes do the actual work in your workflow. They're where things happen: sending emails, asking AI to analyze something, adding rows to spreadsheets, posting to Slack, and more.

## Available Action Nodes

<CardGroup cols={2}>
  <Card title="Ask AI" icon="message-bot" href="/nodes/actions/ask-ai">
    Ask AI to write, summarize, analyze, categorize, or answer questions about text.
  </Card>

  <Card title="Call AI Agent" icon="robot" href="/nodes/actions/call-ai-agent">
    Run another workflow you've built (like calling a helper).
  </Card>

  <Card title="Execute Code" icon="code" href="/nodes/actions/execute-code">
    Run custom Python or JavaScript code for special tasks.
  </Card>

  <Card title="App Action" icon="bolt" href="/nodes/actions/app-action">
    Do things in Gmail, Slack, Google Sheets, HubSpot, and hundreds of other apps.
  </Card>

  <Card title="HTTP Request" icon="globe" href="/nodes/actions/http-request">
    Connect to any website or service to send or receive data.
  </Card>

  <Card title="Update Variable" icon="database" href="/nodes/actions/update-variable">
    Save information to use in later steps.
  </Card>

  <Card title="Read File" icon="file" href="/nodes/actions/read-file">
    Read text from PDFs, Word documents, images, and other files.
  </Card>
</CardGroup>

## Which Action Should I Use?

| I want to...                                        | Use This                                           |
| --------------------------------------------------- | -------------------------------------------------- |
| Have AI write, summarize, or analyze text           | [Ask AI](/nodes/actions/ask-ai)                    |
| Use another workflow I already built                | [Call AI Agent](/nodes/actions/call-ai-agent)      |
| Do something custom with code                       | [Execute Code](/nodes/actions/execute-code)        |
| Send emails, post to Slack, update spreadsheets     | [App Action](/nodes/actions/app-action)            |
| Connect to a website or service not in the app list | [HTTP Request](/nodes/actions/http-request)        |
| Save something to use later                         | [Update Variable](/nodes/actions/update-variable)  |
| Read text from a PDF, Word doc, or image            | [Read File](/nodes/actions/read-file)              |
| Have a back-and-forth conversation with someone     | [Conversation Flows](/conversation-flows/overview) |

## What Information Do Actions Provide?

Each action gives you information you can use in the next steps:

### AI and File Actions

| Node         | What You Get               |
| ------------ | -------------------------- |
| Ask AI       | The AI's response          |
| Read File    | The text from the file     |
| Execute Code | Whatever your code returns |

### App and Web Actions

| Node         | What You Get                                              |
| ------------ | --------------------------------------------------------- |
| App Action   | Depends on what you did (email ID, spreadsheet row, etc.) |
| HTTP Request | The response from the website/service                     |

### Saving Data

| Node            | What You Get                    |
| --------------- | ------------------------------- |
| Update Variable | The value you saved             |
| Call AI Agent   | Whatever that workflow returned |

## What If Something Goes Wrong?

Sometimes things fail - a website is down, your email can't send, etc. CogniAgent has ways to handle this:

### Automatic Retries

Many actions (like Ask AI, HTTP Request, and App Action) automatically try again if they fail the first time. They'll attempt up to 3 times before giving up.

### Checking for Success

You can add a Condition node after an action to check if it worked:

```
├── HTTP Request (get customer data)
├── Condition (did it work?)
│   ├── Yes: Continue with the data
│   └── No: Send alert to Slack
```

### Handling Errors in Code

If you're using Execute Code, you can catch errors:

```python theme={null}
try:
    result = do_something_risky()
    return {"success": True, "data": result}
except Exception as e:
    return {"success": False, "error": str(e)}
```

## Tips

<Tip>
  For complex AI tasks, use multiple Ask AI nodes in sequence - one to analyze, one to decide, one to write. This makes it easier to see what's happening at each step.
</Tip>

<Tip>
  Use Update Variable to save results you'll need later. It's easier to use `{{saved_result.value}}` than to redo work.
</Tip>

<Note>
  Actions run one at a time in order, unless you've created separate paths with a Condition or Multi-Condition node.
</Note>

## Next Steps

<CardGroup cols={2}>
  <Card title="Ask AI Node" icon="message-bot" href="/nodes/actions/ask-ai">
    Start with AI-powered text processing
  </Card>

  <Card title="App Action" icon="bolt" href="/nodes/actions/app-action">
    Connect your workflows to other apps
  </Card>
</CardGroup>
